@chaibuilder/sdk 1.2.5 → 1.2.7
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-MKhgtI8x.cjs +1 -0
- package/dist/{AddBlocks-gbfzju1d.js → AddBlocks-pjLrzkvz.js} +52 -53
- package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-PXCI0z-H.js} +57 -53
- package/dist/BrandingOptions-tZaUILYP.cjs +1 -0
- package/dist/CanvasArea-C2ak1ui1.cjs +60 -0
- package/dist/{CanvasArea-WS9dnLyS.js → CanvasArea-Fhg-6_nZ.js} +407 -407
- package/dist/CurrentPage-4O-iqW3w.cjs +1 -0
- package/dist/{CurrentPage-iaGHiR2B.js → CurrentPage-Zz9LEdez.js} +15 -17
- package/dist/{Layers-V15IDskJ.js → Layers-cgmxKAP9.js} +173 -152
- package/dist/Layers-uo4KpGCs.cjs +1 -0
- package/dist/MarkAsGlobalBlock-1kOwPbPm.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-htrpRVJM.js} +6 -6
- package/dist/{PagesPanel-wfyKhLJ5.js → PagesPanel-TYBKN2Am.js} +8 -10
- package/dist/PagesPanel-z5qHpU24.cjs +1 -0
- package/dist/{ProjectPanel-aiKhpNvr.js → ProjectPanel-PJ1iPaLY.js} +15 -17
- package/dist/ProjectPanel-mEVh8sLb.cjs +1 -0
- package/dist/{Settings-JjYbPJrt.js → Settings-Na0NVS-E.js} +334 -334
- package/dist/Settings-YNxmjfAl.cjs +1 -0
- package/dist/{SidePanels-XABN8kD3.js → SidePanels-bHll6xCt.js} +99 -98
- package/dist/SidePanels-jsHvSEtM.cjs +1 -0
- package/dist/{Topbar-ks1ckGLz.js → Topbar-JKdXHH8P.js} +4 -4
- package/dist/Topbar-jWRuTvxv.cjs +1 -0
- package/dist/UnsplashImages-dBdqJNux.cjs +1 -0
- package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-jiOES16m.js} +7 -7
- package/dist/UploadImages-OD3RPS7j.cjs +1 -0
- package/dist/{UploadImages-6N6UrjLo.js → UploadImages-imersU7l.js} +4 -4
- package/dist/{add-page-modal-Gwhl6J1F.js → add-page-modal-EQWWxbry.js} +10 -11
- package/dist/add-page-modal-nFQ8TUBM.cjs +1 -0
- package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-HOs52FKE.js} +4 -4
- package/dist/confirm-alert-j6hcFSlG.cjs +1 -0
- package/dist/{controls-XPXGHKht.js → controls-QGClapUl.js} +9 -45
- package/dist/{controls-Dy1qa8Dc.cjs → controls-hpe3HxsR.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +56 -58
- package/dist/{delete-page-modal-xGWX8RHn.js → delete-page-modal-DU388lPm.js} +21 -23
- package/dist/delete-page-modal-bkSWhTxz.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +263 -24
- package/dist/{form-Moz_psOw.js → form-7E1GY3U7.js} +1 -1
- package/dist/{form-lJhy9DEC.cjs → form-lF5eSfMe.cjs} +1 -1
- package/dist/html-to-json-JS8zQjYB.cjs +1 -0
- package/dist/{html-to-json-yjzEN9OX.js → html-to-json-lNLC8Y7D.js} +26 -27
- package/dist/{index-7mV_OcXd.js → index-7vwIQQ-T.js} +5402 -5366
- package/dist/index-98CxilGX.cjs +1 -0
- package/dist/{index-mUPP605-.cjs → index-Hf23Fq9m.cjs} +33 -33
- package/dist/{index-_OgCuSUz.js → index-WKIG_VPl.js} +1043 -1036
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +20 -22
- package/dist/mockServiceWorker.js +1 -1
- package/dist/page-viewer-6a4GFMUg.cjs +1 -0
- package/dist/{page-viewer-Xl1i1V3J.js → page-viewer-fohh_Dwv.js} +9 -11
- package/dist/{project-general-setting-8H1Rka2z.js → project-general-setting-Ryf5OhPd.js} +10 -11
- package/dist/project-general-setting-j4lKlLUE.cjs +1 -0
- package/dist/project-seo-setting-CATo4bEL.cjs +1 -0
- package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-KKOCl416.js} +6 -6
- package/dist/{single-page-detail-1hsqXV8c.js → single-page-detail-mJBo7VRe.js} +11 -12
- package/dist/single-page-detail-zms-5Fa_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +7 -9
- package/dist/style.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +18 -18
- package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-CmSt8dRr.js} +1 -1
- package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-pVcDjcgp.cjs} +1 -1
- package/dist/{utils-AvyFzbPC.js → utils-Jw11nj1S.js} +35 -26
- package/dist/utils-j7Kg63NR.cjs +1 -0
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +3 -1049
- package/package.json +5 -5
- package/dist/AddBlocks-wuKI1ieB.cjs +0 -1
- package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
- package/dist/CanvasArea-wpskKN1H.cjs +0 -59
- package/dist/CurrentPage-X9fCVXgY.cjs +0 -1
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/Layers-EGhZWmvD.cjs +0 -1
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
- package/dist/PagesPanel-Vla7HZkm.cjs +0 -1
- package/dist/ProjectPanel-YLS4oOuU.cjs +0 -1
- package/dist/Settings-rnHnjhZ4.cjs +0 -1
- package/dist/SidePanels-vcWHxatg.cjs +0 -1
- package/dist/Topbar-u5XKdWgQ.cjs +0 -1
- package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
- package/dist/UploadImages-eHYxwWAp.cjs +0 -1
- package/dist/add-page-modal-o5dy8nwt.cjs +0 -1
- package/dist/confirm-alert-f3DYO5Hj.cjs +0 -1
- package/dist/delete-page-modal-IO_9ZCm4.cjs +0 -1
- package/dist/html-to-json-5UoswV2Q.cjs +0 -1
- package/dist/index-IIJ_o44s.cjs +0 -1
- package/dist/page-viewer-pJFW_LaN.cjs +0 -1
- package/dist/project-general-setting-lNEoQK1n.cjs +0 -1
- package/dist/project-seo-setting-9JGBPzcA.cjs +0 -1
- package/dist/single-page-detail-VKqGt-s1.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
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.7",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@bobthered/tailwindcss-palette-generator": "3.1.1",
|
|
86
|
-
"@chaibuilder/runtime": "0.2.
|
|
86
|
+
"@chaibuilder/runtime": "0.2.2",
|
|
87
87
|
"@floating-ui/dom": "1.4.5",
|
|
88
88
|
"@floating-ui/react-dom": "2.0.1",
|
|
89
89
|
"@mhsdesign/jit-browser-tailwindcss": "0.4.0",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"react-i18next": "13.0.1",
|
|
151
151
|
"react-icons": "^4.10.1",
|
|
152
152
|
"react-icons-picker": "^1.0.9",
|
|
153
|
-
"react-json-view": "^1.
|
|
153
|
+
"react-json-view-lite": "^1.4.0",
|
|
154
154
|
"react-quill": "^2.0.0",
|
|
155
155
|
"react-textarea-autosize": "^8.5.2",
|
|
156
156
|
"react-wrap-balancer": "^1.0.0",
|
|
@@ -195,8 +195,8 @@
|
|
|
195
195
|
"jsdoc": "^4.0.2",
|
|
196
196
|
"msw": "^2.0.8",
|
|
197
197
|
"postcss": "^8.4.31",
|
|
198
|
-
"prettier": "^3.0
|
|
199
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
198
|
+
"prettier": "^3.3.0",
|
|
199
|
+
"prettier-plugin-tailwindcss": "^0.6.1",
|
|
200
200
|
"prop-types": "^15.8.1",
|
|
201
201
|
"react-router-dom": "^6.19.0",
|
|
202
202
|
"tailwindcss": "^3.3.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),t=require("lodash-es"),R=require("jotai"),q=require("react-i18next"),s=require("./index-IIJ_o44s.cjs"),C=require("@radix-ui/react-icons"),b=require("@chaibuilder/runtime"),w=require("flagged"),N=require("lucide-react"),B=require("react-dnd"),A=require("./html-to-json-5UoswV2Q.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");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-scroll-area");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-dom");require("react-quill");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@react-hookz/web");require("himalaya");require("lodash");const S=({block:r})=>{const{type:o,icon:i,label:n}=r,{addCoreBlock:m,addPredefinedBlock:d}=s.useAddBlock(),[p,l]=s.useSelectedBlockIds(),[,h]=s.useHighlightBlockId(),[,j]=R.useAtom(s.activePanelAtom),u=()=>{t.has(r,"blocks")?d(b.syncBlocksWithDefaults(r.blocks),t.first(p)):m(r,t.first(p)),j("layers")},c=w.useFeature("dnd");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:u,type:"button",onDragStart:g=>{g.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{l([]),h(null),j("layers")},200)},draggable:c?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(c?"cursor-grab":"cursor-pointer"),children:[a.createElement(i||C.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:n||o})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:n||o})})]})})},I=({block:r,closePopover:o})=>{var c;const[i,n]=a.useState(!1),m=s.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:d,addPredefinedBlock:p}=s.useAddBlock(),[l]=s.useSelectedBlockIds(),[,h,j]=B.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),u=a.useCallback(async g=>{if(g.stopPropagation(),t.has(r,"component")){d(r,t.first(l)),o();return}n(!0);const f=await m(r);t.isEmpty(f)||p(b.syncBlocksWithDefaults(f),t.first(l)),o()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(B.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+((c=r.name||r.label)==null?void 0:c.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:h,onClick:i?()=>{}:u,className:"relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[i&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(N.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:r.label}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:r.label})})]})]})},P=()=>{const{data:r}=s.useUILibraryBlocks(),o=b.useChaiBlocks(),i=t.filter(t.values(o),{category:"custom"}),n=t.groupBy(i,"group"),m=t.groupBy(r,"group"),d=a.useMemo(()=>t.mergeWith(n,m,(u,c)=>{if(t.isArray(u)&&t.isArray(c))return[...u,...c]}),[n,m]),[p,l]=a.useState(t.first(t.keys(d))||""),[,h]=R.useAtom(s.activePanelAtom),j=t.get(d,p,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col h-full max-h-full overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("div",{className:"p-3 sticky top-0 flex w-full items-center",children:e.jsxRuntimeExports.jsxs(s.Select,{value:p,onValueChange:u=>l(u),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:"Choose"}),a.Children.toArray(t.map(d,(u,c)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:c,children:c},c)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:a.Children.toArray(j.map(u=>e.jsxRuntimeExports.jsx(I,{block:u,closePopover:()=>h("layers")})))})]})},_=()=>{const{t:r}=q.useTranslation(),[o,i]=a.useState(""),{addPredefinedBlock:n}=s.useAddBlock(),[m]=s.useSelectedBlockIds(),[,d]=R.useAtom(s.activePanelAtom),p=()=>{const l=A.getBlocksFromHTML(o);n([...l],t.first(m)||null),i(""),d("layers")};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:l=>l&&l.focus(),onChange:l=>i(l.target.value),rows:12,value:o,placeholder:r("enter_code_snippet"),className:"resize-none bg-gray-100 overflow-x-auto whitespace-pre text-xs font-mono font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:o.trim()==="",onClick:()=>p(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 p-1 border-none text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},k=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],L=(r,o)=>{if(!r)return!t.includes(k,o);const i=r._type;return i==="List"?o==="ListItem":i==="Table"?o==="TableHead"||o==="TableBody":i==="TableHead"||i==="TableBody"?o==="TableRow":i==="TableRow"?o==="TableCell":i==="Row"?o==="Column":!t.includes(k,o)},H=()=>{const{t:r}=q.useTranslation(),[o,i]=a.useState("core"),[n,m]=a.useState("basic"),d=b.useChaiBlocks(),[,p]=R.useAtom(s.showPredefinedBlockCategoryAtom),l=s.useBuilderProp("importHTMLSupport",!0),[h]=s.useSelectedBlockIds(),j=s.useAllBlocks(),u=t.find(j,{_id:t.first(h)}),{data:c,isLoading:g}=s.useUILibraryBlocks(),f=t.groupBy(t.filter(d,x=>L(u,x.type)),"category"),E=t.uniq(t.map(f.core,"group"));a.useEffect(()=>{!t.includes(E,n)&&!t.isEmpty(E)&&!t.isEmpty(n)&&m(t.first(E))},[E,n]);const T=x=>m(y=>y===x?"":x),v=!g&&!t.isEmpty(c)||t.find(t.values(d),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:r("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r(o==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:x=>{p(""),i(x)},value:o,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(v&&l?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("core")}),v?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:r("custom_blocks")}):null,l?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),o==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:n,className:"w-full px-3",children:a.Children.toArray(t.map(E,x=>t.reject(t.filter(t.values(f.core),{group:x}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:x,className:"border-border",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{onClick:()=>T(x),className:"py-2 capitalize",children:x}),e.jsxRuntimeExports.jsx(s.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:a.Children.toArray(t.reject(t.filter(t.values(f.core),{group:x}),{hidden:!0}).map(y=>e.jsxRuntimeExports.jsx(S,{block:y})))})})]}):null))})}),o==="ui-blocks"&&e.jsxRuntimeExports.jsx(a.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(P,{})}),o==="html"&&l?e.jsxRuntimeExports.jsx(_,{}):null]})};exports.default=H;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),j=require("react"),B=require("@rjsf/validator-ajv8"),R=require("@rjsf/core"),g=require("./index-IIJ_o44s.cjs"),r=require("./controls-Dy1qa8Dc.cjs"),m=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");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-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");function E(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const x=E(j),N=({value:t,onChange:e,id:i,onBlur:a})=>{const d=m.debounce(e,200),c=n=>d(n.target.value);return l.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:l.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:l.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:n}})=>a(i,n),onChange:c})})})},f=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],P=()=>{const t=g.useBuilderProp("onSaveBrandingOptions",async()=>{}),[e,i]=g.useBrandingOptions(),a=x.useRef(e);x.useEffect(()=>()=>{m.isEqual(e,a.current)||t(a.current)},[]);const d=({formData:o},s)=>{s&&(i(o),a.current=o)},{bodyFont:c,headingFont:n,primaryColor:y,bodyTextDarkColor:q,bodyTextLightColor:b,bodyBgDarkColor:h,secondaryColor:S,bodyBgLightColor:C,roundedCorners:O}=e,v={headingFont:r.f({title:"Heading font",default:n,options:f}),bodyFont:r.f({title:"Body font",default:c,options:f}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(O||5,10)}),primaryColor:r.y({title:"Primary",default:y}),secondaryColor:r.y({title:"Secondary",default:S}),bodyBgLightColor:r.y({title:"Body Background (Light)",default:C}),bodyBgDarkColor:r.y({title:"Body Background (Dark)",default:h}),bodyTextLightColor:r.y({title:"Body Text (Light)",default:q}),bodyTextDarkColor:r.y({title:"Body Text (Dark)",default:b})},u={type:"object",properties:{}},p={};return Object.keys(v).forEach(o=>{const s=v[o];return u.properties||(u.properties={}),u.properties[o]=s.schema,p[o]=s.uiSchema,!0}),l.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[l.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:l.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),l.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:l.jsxRuntimeExports.jsx(R,{widgets:{color:N},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:p,schema:u,formData:e,validator:B,onChange:d})})]})};exports.default=P;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";var $e=Object.defineProperty;var Ue=(e,t,n)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>(Ue(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),p=require("lodash-es"),L=require("@radix-ui/react-icons"),o=require("./index-IIJ_o44s.cjs"),ne=require("react-i18next"),H=require("jotai"),ge=require("react-dom"),ze=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-mUPP605-.cjs"),Ye=require("react-quill"),Ke=require("./useAddBlockByDrop-_nd8yZBa.cjs"),Ce=require("flagged"),Je=require("@floating-ui/dom"),me=require("@floating-ui/react-dom"),Ve=require("@react-hookz/web"),Ze=require("@bobthered/tailwindcss-palette-generator"),Qe=require("react-wrap-balancer"),Ge=require("tailwind-merge"),ee=require("./MODIFIERS-2FeVfZQ9.cjs"),Xe=require("@chaibuilder/runtime");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("clsx");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-scroll-area");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("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("i18next");require("react-textarea-autosize");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const et=()=>{const{undoCount:e,redoCount:t,undo:n,redo:i}=o.useCanvasHistory();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Button,{disabled:!e,size:"sm",onClick:n,className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{})}),s.jsxRuntimeExports.jsx(o.Button,{disabled:!t,onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function tt(){const[e,t]=o.useDarkMode(),{t:n}=ne.useTranslation();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Label,{htmlFor:"dark-mode-switch",children:n("dark_mode")}),s.jsxRuntimeExports.jsxs(o.Switch,{id:"dark-mode-switch",checked:e,onCheckedChange:()=>{t(!e)},className:`${e?"bg-violet-600":"bg-violet-300"}
|
|
2
|
-
relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[s.jsxRuntimeExports.jsx("span",{className:"sr-only",children:n("use_setting")}),s.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${e?"translate-x-5":"translate-x-0"}
|
|
3
|
-
pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const ye=({landscape:e=!1})=>s.jsxRuntimeExports.jsxs("svg",{className:e?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[s.jsxRuntimeExports.jsx("g",{strokeWidth:0}),s.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),s.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),nt=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:s.jsxRuntimeExports.jsx(L.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:s.jsxRuntimeExports.jsx(L.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:s.jsxRuntimeExports.jsx(ye,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:s.jsxRuntimeExports.jsx(ye,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:s.jsxRuntimeExports.jsx(L.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:s.jsxRuntimeExports.jsx(L.DesktopIcon,{}),width:1920}],ve=({title:e,content:t,currentBreakpoint:n,breakpoint:i,width:a,icon:l,onClick:u})=>{const{t:r}=ne.useTranslation();return s.jsxRuntimeExports.jsxs(o.HoverCard,{children:[s.jsxRuntimeExports.jsx(o.HoverCardTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx(o.Button,{onClick:()=>u(a),size:"sm",variant:i===n?"secondary":"ghost",children:l})}),s.jsxRuntimeExports.jsx(o.HoverCardContent,{className:"w-52 border-border",children:s.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:s.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[s.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:r(e)}),s.jsxRuntimeExports.jsx("p",{className:"text-xs",children:r(t)})]})})})]})},st=()=>{const[,e,t]=o.useCanvasWidth(),[n,i]=o.useSelectedBreakpoints(),{t:a}=ne.useTranslation(),l=o.useBuilderProp("breakpoints",nt),u=r=>{n.includes(r)?n.length>2&&i(n.filter(d=>d!==r)):i(d=>[...d,r])};return l.length<4?s.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:p.map(l,r=>g.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e}))}):s.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[p.map(l.filter(r=>p.includes(n,p.toUpper(r.breakpoint))),r=>g.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e})),s.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[s.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:s.jsxRuntimeExports.jsx(L.DotsVerticalIcon,{className:"scale-90 transform"})})}),s.jsxRuntimeExports.jsxs(o.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[s.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:a("Breakpoints")}),s.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),p.map(l,r=>s.jsxRuntimeExports.jsx(o.DropdownMenuCheckboxItem,{disabled:r.breakpoint==="xs",onCheckedChange:()=>u(p.toUpper(r.breakpoint)),checked:p.includes(n,p.toUpper(r.breakpoint)),children:a(r.title)},r.breakpoint))]})]})]})},rt=()=>{const{t:e}=ne.useTranslation(),[t]=o.useSetAllBlocks(),{createSnapshot:n}=o.useCanvasHistory(),[,i]=o.useSelectedBlockIds(),[,a]=o.useSelectedStylingBlocks(),l=g.useCallback(()=>{t([]),i([]),a([]),n()},[t,n]);return s.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:s.jsxRuntimeExports.jsxs(o.AlertDialog,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsxs(o.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[s.jsxRuntimeExports.jsx(L.EraserIcon,{})," ",e("clear")]})}),s.jsxRuntimeExports.jsxs(o.AlertDialogContent,{className:"border-border",children:[s.jsxRuntimeExports.jsxs(o.AlertDialogHeader,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTitle,{children:e("clear_canvas_title")}),s.jsxRuntimeExports.jsx(o.AlertDialogDescription,{children:e("clear_canvas_description")})]}),s.jsxRuntimeExports.jsxs(o.AlertDialogFooter,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogCancel,{children:e("cancel")}),s.jsxRuntimeExports.jsx(o.AlertDialogAction,{onClick:l,children:e("yes")})]})]})]})})},ot=()=>{const e=o.useFeatureSupport("darkMode",!1),[t]=o.useCanvasZoom();return s.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[s.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[e?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(tt,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"})]}):null,s.jsxRuntimeExports.jsx(st,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[s.jsxRuntimeExports.jsx(L.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",s.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[p.round(t,0),"%"]})]}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(et,{})]}),s.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(rt,{})]})]})},it=`<!doctype html>
|
|
4
|
-
<html class="scroll-smooth h-full overflow-y-auto">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<script src="https://old.chaibuilder.com/offline/tailwind.cdn.js"><\/script>
|
|
9
|
-
<style>
|
|
10
|
-
html { height: 100%; overflow:auto; }
|
|
11
|
-
body { height: 100%; }
|
|
12
|
-
.air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
|
|
13
|
-
.air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
|
|
14
|
-
body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
|
|
15
|
-
-moz-user-select: none;-ms-user-select: none; user-select: none; }
|
|
16
|
-
html{
|
|
17
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
18
|
-
scrollbar-width: none; /* Firefox */
|
|
19
|
-
}
|
|
20
|
-
/** IMPORTANT: Make fields content editable in SAFARI */
|
|
21
|
-
[contenteditable] {-webkit-user-select: text;user-select: text;}
|
|
22
|
-
|
|
23
|
-
html::-webkit-scrollbar { width: 0 !important }
|
|
24
|
-
.aspect-auto{aspect-ratio: auto;}
|
|
25
|
-
.aspect-square{aspect-ratio: 1/1;}
|
|
26
|
-
.aspect-video{aspect-ratio: 16/9;}
|
|
27
|
-
.dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
|
|
28
|
-
.dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
|
|
29
|
-
a{ pointer-events: none !important; }
|
|
30
|
-
[contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
|
|
31
|
-
[contenteditable="true"] {
|
|
32
|
-
outline: none;
|
|
33
|
-
box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
|
|
34
|
-
-webkit-user-select: text;
|
|
35
|
-
-moz-user-select: text;
|
|
36
|
-
user-select: text;
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
39
|
-
<style id="hidden-blocks"></style>
|
|
40
|
-
<style id="selected-block"></style>
|
|
41
|
-
<style id="selected-styling-block"></style>
|
|
42
|
-
<style id="highlighted-block"></style>
|
|
43
|
-
<style id="dragged-block"></style>
|
|
44
|
-
|
|
45
|
-
</head>
|
|
46
|
-
<body class="font-body antialiased h-full">
|
|
47
|
-
<div class="frame-root"></div>
|
|
48
|
-
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
49
|
-
</body>
|
|
50
|
-
</html>`,at=e=>{const[t]=o.useCanvasWidth(),[,n]=o.useCanvasZoom(),[i,a]=g.useState({}),l=g.useCallback(()=>{const{width:u,height:r}=e;if(u<t){const d=parseFloat((u/t).toFixed(2).toString());let x={};const h=r*d;r&&(x={height:100+(r-h)/h*100+"%"}),a({position:"relative",top:0,transform:`scale(${d})`,transformOrigin:"top left",...x,maxWidth:"none"}),n(d*100)}else a({}),n(100)},[t,e,n]);return g.useEffect(()=>{l()},[t,e,n,l]),i};var te={exports:{}};/*
|
|
51
|
-
object-assign
|
|
52
|
-
(c) Sindre Sorhus
|
|
53
|
-
@license MIT
|
|
54
|
-
*/var re,je;function lt(){if(je)return re;je=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(l){if(l==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(l)}function a(){try{if(!Object.assign)return!1;var l=new String("abc");if(l[5]="de",Object.getOwnPropertyNames(l)[0]==="5")return!1;for(var u={},r=0;r<10;r++)u["_"+String.fromCharCode(r)]=r;var d=Object.getOwnPropertyNames(u).map(function(h){return u[h]});if(d.join("")!=="0123456789")return!1;var x={};return"abcdefghijklmnopqrst".split("").forEach(function(h){x[h]=h}),Object.keys(Object.assign({},x)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return re=a()?Object.assign:function(l,u){for(var r,d=i(l),x,h=1;h<arguments.length;h++){r=Object(arguments[h]);for(var m in r)t.call(r,m)&&(d[m]=r[m]);if(e){x=e(r);for(var y=0;y<x.length;y++)n.call(r,x[y])&&(d[x[y]]=r[x[y]])}}return d},re}var oe,Ee;function fe(){if(Ee)return oe;Ee=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return oe=e,oe}var ie,be;function Te(){return be||(be=1,ie=Function.call.bind(Object.prototype.hasOwnProperty)),ie}var ae,ke;function ct(){if(ke)return ae;ke=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=fe(),n={},i=Te();e=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function a(l,u,r,d,x){if(process.env.NODE_ENV!=="production"){for(var h in l)if(i(l,h)){var m;try{if(typeof l[h]!="function"){var y=Error((d||"React class")+": "+r+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof l[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}m=l[h](u,h,d,r,null,t)}catch(q){m=q}if(m&&!(m instanceof Error)&&e((d||"React class")+": type specification of "+r+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in n)){n[m.message]=!0;var B=x?x():"";e("Failed "+r+" type: "+m.message+(B??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ae=a,ae}var le,Re;function dt(){if(Re)return le;Re=1;var e=G.reactIsExports,t=lt(),n=fe(),i=Te(),a=ct(),l=function(){};process.env.NODE_ENV!=="production"&&(l=function(r){var d="Warning: "+r;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function u(){return null}return le=function(r,d){var x=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function m(c){var f=c&&(x&&c[x]||c[h]);if(typeof f=="function")return f}var y="<<anonymous>>",B={array:D("array"),bigint:D("bigint"),bool:D("boolean"),func:D("function"),number:D("number"),object:D("object"),string:D("string"),symbol:D("symbol"),any:O(),arrayOf:w,element:F(),elementType:W(),instanceOf:_,node:Me(),objectOf:U,oneOf:$,oneOfType:Pe,shape:Le,exact:Ne};function q(c,f){return c===f?c!==0||1/c===1/f:c!==c&&f!==f}function k(c,f){this.message=c,this.data=f&&typeof f=="object"?f:{},this.stack=""}k.prototype=Error.prototype;function A(c){if(process.env.NODE_ENV!=="production")var f={},R=0;function E(S,j,b,C,I,T,N){if(C=C||y,T=T||b,N!==n){if(d){var P=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw P.name="Invariant Violation",P}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var J=C+":"+b;!f[J]&&R<3&&(l("You are manually calling a React.PropTypes validation function for the `"+T+"` prop on `"+C+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),f[J]=!0,R++)}}return j[b]==null?S?j[b]===null?new k("The "+I+" `"+T+"` is marked as required "+("in `"+C+"`, but its value is `null`.")):new k("The "+I+" `"+T+"` is marked as required in "+("`"+C+"`, but its value is `undefined`.")):null:c(j,b,C,I,T)}var v=E.bind(null,!1);return v.isRequired=E.bind(null,!0),v}function D(c){function f(R,E,v,S,j,b){var C=R[E],I=z(C);if(I!==c){var T=V(C);return new k("Invalid "+S+" `"+j+"` of type "+("`"+T+"` supplied to `"+v+"`, expected ")+("`"+c+"`."),{expectedType:c})}return null}return A(f)}function O(){return A(u)}function w(c){function f(R,E,v,S,j){if(typeof c!="function")return new k("Property `"+j+"` of component `"+v+"` has invalid PropType notation inside arrayOf.");var b=R[E];if(!Array.isArray(b)){var C=z(b);return new k("Invalid "+S+" `"+j+"` of type "+("`"+C+"` supplied to `"+v+"`, expected an array."))}for(var I=0;I<b.length;I++){var T=c(b,I,v,S,j+"["+I+"]",n);if(T instanceof Error)return T}return null}return A(f)}function F(){function c(f,R,E,v,S){var j=f[R];if(!r(j)){var b=z(j);return new k("Invalid "+v+" `"+S+"` of type "+("`"+b+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return A(c)}function W(){function c(f,R,E,v,S){var j=f[R];if(!e.isValidElementType(j)){var b=z(j);return new k("Invalid "+v+" `"+S+"` of type "+("`"+b+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return A(c)}function _(c){function f(R,E,v,S,j){if(!(R[E]instanceof c)){var b=c.name||y,C=We(R[E]);return new k("Invalid "+S+" `"+j+"` of type "+("`"+C+"` supplied to `"+v+"`, expected ")+("instance of `"+b+"`."))}return null}return A(f)}function $(c){if(!Array.isArray(c))return process.env.NODE_ENV!=="production"&&(arguments.length>1?l("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):l("Invalid argument supplied to oneOf, expected an array.")),u;function f(R,E,v,S,j){for(var b=R[E],C=0;C<c.length;C++)if(q(b,c[C]))return null;var I=JSON.stringify(c,function(N,P){var J=V(P);return J==="symbol"?String(P):P});return new k("Invalid "+S+" `"+j+"` of value `"+String(b)+"` "+("supplied to `"+v+"`, expected one of "+I+"."))}return A(f)}function U(c){function f(R,E,v,S,j){if(typeof c!="function")return new k("Property `"+j+"` of component `"+v+"` has invalid PropType notation inside objectOf.");var b=R[E],C=z(b);if(C!=="object")return new k("Invalid "+S+" `"+j+"` of type "+("`"+C+"` supplied to `"+v+"`, expected an object."));for(var I in b)if(i(b,I)){var T=c(b,I,v,S,j+"."+I,n);if(T instanceof Error)return T}return null}return A(f)}function Pe(c){if(!Array.isArray(c))return process.env.NODE_ENV!=="production"&&l("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var f=0;f<c.length;f++){var R=c[f];if(typeof R!="function")return l("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+He(R)+" at index "+f+"."),u}function E(v,S,j,b,C){for(var I=[],T=0;T<c.length;T++){var N=c[T],P=N(v,S,j,b,C,n);if(P==null)return null;P.data&&i(P.data,"expectedType")&&I.push(P.data.expectedType)}var J=I.length>0?", expected one of type ["+I.join(", ")+"]":"";return new k("Invalid "+b+" `"+C+"` supplied to "+("`"+j+"`"+J+"."))}return A(E)}function Me(){function c(f,R,E,v,S){return X(f[R])?null:new k("Invalid "+v+" `"+S+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return A(c)}function he(c,f,R,E,v){return new k((c||"React class")+": "+f+" type `"+R+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+v+"`.")}function Le(c){function f(R,E,v,S,j){var b=R[E],C=z(b);if(C!=="object")return new k("Invalid "+S+" `"+j+"` of type `"+C+"` "+("supplied to `"+v+"`, expected `object`."));for(var I in c){var T=c[I];if(typeof T!="function")return he(v,S,j,I,V(T));var N=T(b,I,v,S,j+"."+I,n);if(N)return N}return null}return A(f)}function Ne(c){function f(R,E,v,S,j){var b=R[E],C=z(b);if(C!=="object")return new k("Invalid "+S+" `"+j+"` of type `"+C+"` "+("supplied to `"+v+"`, expected `object`."));var I=t({},R[E],c);for(var T in I){var N=c[T];if(i(c,T)&&typeof N!="function")return he(v,S,j,T,V(N));if(!N)return new k("Invalid "+S+" `"+j+"` key `"+T+"` supplied to `"+v+"`.\nBad object: "+JSON.stringify(R[E],null," ")+`
|
|
55
|
-
Valid keys: `+JSON.stringify(Object.keys(c),null," "));var P=N(b,T,v,S,j+"."+T,n);if(P)return P}return null}return A(f)}function X(c){switch(typeof c){case"number":case"string":case"undefined":return!0;case"boolean":return!c;case"object":if(Array.isArray(c))return c.every(X);if(c===null||r(c))return!0;var f=m(c);if(f){var R=f.call(c),E;if(f!==c.entries){for(;!(E=R.next()).done;)if(!X(E.value))return!1}else for(;!(E=R.next()).done;){var v=E.value;if(v&&!X(v[1]))return!1}}else return!1;return!0;default:return!1}}function Fe(c,f){return c==="symbol"?!0:f?f["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&f instanceof Symbol:!1}function z(c){var f=typeof c;return Array.isArray(c)?"array":c instanceof RegExp?"object":Fe(f,c)?"symbol":f}function V(c){if(typeof c>"u"||c===null)return""+c;var f=z(c);if(f==="object"){if(c instanceof Date)return"date";if(c instanceof RegExp)return"regexp"}return f}function He(c){var f=V(c);switch(f){case"array":case"object":return"an "+f;case"boolean":case"date":case"regexp":return"a "+f;default:return f}}function We(c){return!c.constructor||!c.constructor.name?y:c.constructor.name}return B.checkPropTypes=a,B.resetWarningCache=a.resetWarningCache,B.PropTypes=B,B},le}var ce,we;function ut(){if(we)return ce;we=1;var e=fe();function t(){}function n(){}return n.resetWarningCache=t,ce=function(){function i(u,r,d,x,h,m){if(m!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}i.isRequired=i;function a(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return l.PropTypes=l,l},ce}var Wt=te.exports;if(process.env.NODE_ENV!=="production"){var pt=G.reactIsExports,ft=!0;te.exports=dt()(pt.isElement,ft)}else te.exports=ut()();var xt=te.exports;const M=ze.getDefaultExportFromCjs(xt);let Ie,Be;typeof document<"u"&&(Ie=document);typeof window<"u"&&(Be=window);const Ae=g.createContext({document:Ie,window:Be}),se=()=>g.useContext(Ae),{Provider:ht,Consumer:$t}=Ae;class De extends g.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return g.Children.only(this.props.children)}}K(De,"propTypes",{children:M.element.isRequired,contentDidMount:M.func.isRequired,contentDidUpdate:M.func.isRequired});class ue extends g.Component{constructor(n,i){super(n,i);K(this,"setRef",n=>{this.nodeRef.current=n;const{forwardedRef:i}=this.props;typeof i=="function"?i(n):i&&(i.current=n)});K(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});K(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=g.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const n=this.getDoc();return this.props.mountTarget?n.querySelector(this.props.mountTarget):n.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const n=this.getDoc();if(!n)return null;const i=this.props.contentDidMount,a=this.props.contentDidUpdate,l=n.defaultView||n.parentView,u=s.jsxRuntimeExports.jsx(De,{contentDidMount:i,contentDidUpdate:a,children:s.jsxRuntimeExports.jsx(ht,{value:{document:n,window:l},children:s.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),r=this.getMountTarget();return[ge.createPortal(this.props.head,this.getDoc().head),ge.createPortal(u,r)]}render(){const n={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete n.head,delete n.initialContent,delete n.mountTarget,delete n.contentDidMount,delete n.contentDidUpdate,delete n.forwardedRef,s.jsxRuntimeExports.jsx("iframe",{...n,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}K(ue,"propTypes",{style:M.object,head:M.node,initialContent:M.string,mountTarget:M.string,contentDidMount:M.func,contentDidUpdate:M.func,children:M.oneOfType([M.element,M.arrayOf(M.element)])}),K(ue,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const gt=g.forwardRef((e,t)=>s.jsxRuntimeExports.jsx(ue,{...e,forwardedRef:t}));let Y=null,Q=[],Z=null,_e=null;function mt(e){const t=window.getComputedStyle(e),n=parseInt(t.paddingLeft,10),i=parseInt(t.paddingTop,10),a=parseInt(t.paddingRight,10),l=parseInt(t.paddingBottom,10);return{paddingLeft:n,paddingTop:i,paddingRight:a,paddingBottom:l}}const Se=(e,t,n)=>{if(!Y)return;const i=e.getBoundingClientRect(),a=Y==null?void 0:Y.getElementById("placeholder"),{paddingLeft:l,paddingTop:u,paddingRight:r,paddingBottom:d}=mt(e);a.style.width=t==="vertical"?i.width-l-r+"px":"2px",a.style.height=t==="vertical"?"2px":i.height-u-d+"px",a.style.display="block";const x=Q.reduce((h,m)=>Math.abs(m-n)<Math.abs(h-n)?m:h);_e=Q.indexOf(x),t==="vertical"?(a.style.top=e.offsetTop+x+"px",a.style.left=e.offsetLeft+l+"px"):(a.style.top=e.offsetTop+u+"px",a.style.left=e.offsetLeft+x+"px")},yt=e=>{const t=Oe(e),n=window.getComputedStyle(e),i=t==="horizontal",a=parseInt(n.paddingLeft),l=parseInt(n.paddingTop);let u=i?a:l;Q=[u],Array.from(e.children).forEach(r=>{const d=window.getComputedStyle(r),x=parseInt(i?d.marginLeft+d.marginRight:d.marginTop+d.marginBottom),h=i?r.offsetWidth:r.offsetHeight;Q.push(u+h+x),u+=h+x})};function Oe(e){const t=window.getComputedStyle(e).display,n=window.getComputedStyle(e).flexDirection;if(t==="flex")return n==="column"||n==="column-reverse"?"vertical":"horizontal";if(t==="grid"){const i=window.getComputedStyle(e).gridTemplateRows,a=window.getComputedStyle(e).gridTemplateColumns;if(i.includes("auto"))return"vertical";if(a.includes("auto"))return"horizontal"}return t==="block"?"vertical":"horizontal"}const vt=p.throttle(e=>{const t=e.target,n=Oe(t);if(n==="vertical"){const i=e.clientY-t.offsetTop;Se(t,n,i)}else{const i=e.clientX-t.offsetLeft;Se(t,n,i)}},200),jt=e=>{e.preventDefault(),e.stopPropagation(),vt(e)};function de(){const e=Y==null?void 0:Y.getElementById("placeholder");e.style.display="none"}const Et=()=>{const{document:e}=se(),[t,n]=H.useAtom(o.draggingFlagAtom),i=Ke.useAddBlockByDrop(),a=Ce.useFeature("dnd"),[,l]=o.useHighlightBlockId(),[,u]=o.useSelectedBlockIds();return Y=e,{isDragging:t,"data-dnd":"branch",onDragOver:a?jt:p.noop,onDrop:a?r=>{Z==null||Z.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2");const d=JSON.parse(r.dataTransfer.getData("text/plain"));let x=r.target.getAttribute("data-block-id");x===null&&(x=r.target.parentElement.getAttribute("data-block-id")),i({block:d,dropTargetId:x||null,relativeIndex:_e}),n(!1),de(),setTimeout(()=>{de()},300)}:p.noop,onDragEnter:a?r=>{const d=r;Z=d.target,d.stopPropagation(),d.preventDefault(),Q=[];const x=d.target;yt(x),x.classList.add("outline","outline-green-300","outline-2","-outline-offset-2"),n(!0),l(""),u([])}:p.noop,onDragLeave:a?r=>{const d=r;Z=null,d.stopPropagation(),d.preventDefault(),d.target.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2")}:p.noop,onMouseOut:a?()=>{n(!1),de()}:p.noop}};function xe(e){return e.getAttribute("data-block-id")?e:e.closest("[data-block-id]")}function bt(e){e.container.innerHTML="",e.container.parentNode.removeChild(e.container);var t=document.querySelector(".ql-toolbar");t&&t.parentNode.removeChild(t),e=null}const kt=()=>{const e=["Heading","Paragraph","Text","Link","Span","Button"],t=o.useUpdateBlocksProps(),[,n]=o.useHighlightBlockId(),[i,a]=H.useAtom(o.inlineEditingActiveAtom);return l=>{var m;if(i)return;const u=xe(l.target),r=u.getAttribute("data-block-type");if(!r||!e.includes(r))return;const d=u.cloneNode(!0);u.style.display="none",Array.from(d.attributes).forEach(y=>{y.name!=="class"&&d.removeAttribute(y.name)}),r==="Text"&&(d.style.display="inline-block"),u.parentNode.insertBefore(d,u.nextSibling);const x=new Ye.Quill(d,{placeholder:"Type here..."});function h(){const y=x.getText(0,x.getLength());t([u.getAttribute("data-block-id")],{content:y}),u.removeAttribute("style"),d.removeEventListener("blur",h,!0),bt(x),a(""),n("")}d.addEventListener("blur",h,!0),x.focus(),(m=d.querySelector(".ql-clipboard"))==null||m.remove(),a(u.getAttribute("data-block-id"))}},Rt=()=>{const[,e]=o.useSelectedStylingBlocks(),[,t]=o.useSelectedBlockIds(),[n]=H.useAtom(o.inlineEditingActiveAtom);return i=>{if(n)return;i.stopPropagation();const a=xe(i.target);if(a!=null&&a.getAttribute("data-block-parent")){const l=a.getAttribute("data-style-prop"),u=a.getAttribute("data-style-id"),r=a.getAttribute("data-block-parent");e([{id:u,prop:l,blockId:r}]),t([r])}else a!=null&&a.getAttribute("data-block-id")&&t([a.getAttribute("data-block-id")])}},wt=p.throttle((e,t)=>{const n=xe(e.target);n!=null&&n.getAttribute("data-style-id")&&t(n.getAttribute("data-style-id"))},100),St=()=>{const[,e]=o.useHighlightBlockId(),[t]=H.useAtom(o.inlineEditingActiveAtom);return n=>{t||wt(n,e)}},Ct=({children:e})=>{const{document:t}=se(),[n]=o.useSelectedBlockIds(),[i,a]=o.useSelectedStylingBlocks();g.useEffect(()=>{setTimeout(()=>{if(!p.isEmpty(i))return;const x=qe(t,p.first(n));if(x){const h=x.getAttribute("data-style-prop");if(h){const m=x.getAttribute("data-style-id"),y=x.getAttribute("data-block-parent");a([{id:m,prop:h,blockId:y}])}}},100)},[t,n,a,i]);const l=kt(),u=Rt(),r=St(),d=Et();return s.jsxRuntimeExports.jsx("div",{id:"canvas",onClick:u,onDoubleClick:l,onMouseMove:r,...p.omit(d,"isDragging"),className:"relative mb-5 max-w-full "+(d.isDragging?"dragging":""),children:e})},qe=(e,t)=>e.querySelector(`[data-block-id="${t}"]`),Tt=()=>{const{window:e}=se(),[t,n]=o.useSelectedBlockIds(),i=o.useAllBlocks(),[,a]=o.useSelectedStylingBlocks(),{undo:l,redo:u}=o.useCanvasHistory(),r=o.useDuplicateBlocks(),[,d]=o.useCutBlockIds(),[,x]=o.useCopyBlockIds(),{pasteBlocks:h}=o.usePasteBlocks(),[,m]=o.usePreviewMode(),y=o.useRemoveBlocks(),{savePage:B}=o.useSavePage(),[q]=H.useAtom(o.inlineEditingActiveAtom),[,k]=H.useAtom(o.editLayerNameAtom),A=O=>{O.key==="Enter"&&(O.preventDefault(),t.length===1&&k(p.first(t)))},D=O=>{const w=i.find(F=>F._id===O);return w?w._parent:null};return g.useEffect(()=>{const O=w=>{if(w.key==="Escape"){n([]),a([]);return}if(A(w),!q&&(w.key==="Delete"||w.key==="Backspace")&&(w.preventDefault(),y(t)),w.ctrlKey||w.metaKey){if(w.key==="ArrowUp"){w.preventDefault();const F=t.length>0?D(t[0]):null;F&&n([F])}if(["z","y","d","x","c","p","s","v"].includes(w.key)){if(q&&["x","z","v"].includes(w.key))return!0;w.preventDefault()}w.key==="s"&&(w.stopPropagation(),w.preventDefault(),B()),w.key==="z"&&l(),w.key==="y"&&u(),w.key==="d"&&r(t),w.key==="x"&&d(t),w.key==="c"&&x(t),w.key==="v"&&t.length>0&&h(t[0])}};return e.removeEventListener("keydown",O),e.addEventListener("keydown",O),()=>{e.removeEventListener("keydown",O)}},[t,n,l,y,m,u,r,d,x,h,q,B,e]),null},It=({block:e,label:t})=>{const[,n]=o.useSelectedBlockIds(),[,i]=o.useHighlightBlockId(),[,a]=H.useAtom(o.draggedBlockIdAtom),l=Ce.useFeature("dnd");return s.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",draggable:l?"true":"false",onDragStart:u=>{u.dataTransfer.setData("text/plain",JSON.stringify(p.pick(e,["_id","_type"]))),a(e._id),setTimeout(()=>{n([]),i(null)},200)},children:[s.jsxRuntimeExports.jsx(L.DragHandleDots2Icon,{}),t]})},Bt=({selectedBlockElement:e,block:t})=>{const n=o.useRemoveBlocks(),i=o.useDuplicateBlocks(),[,a]=o.useSelectedBlockIds(),[,l]=o.useSelectedStylingBlocks(),[u]=H.useAtom(o.inlineEditingActiveAtom),{floatingStyles:r,refs:d,update:x}=me.useFloating({placement:"top-start",middleware:[me.shift(),Je.flip()],elements:{reference:e}});Ve.useResizeObserver(e,()=>x(),e!==null);const h=p.get(t,"_parent",null),m=p.isEmpty(p.get(t,"_name",""))?p.get(t,"_type",""):p.get(t,"_name","");return!e||!t||u?null:s.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:r,onClick:y=>{y.stopPropagation(),y.preventDefault()},onKeyDown:y=>y.stopPropagation(),className:"z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[s.jsxRuntimeExports.jsx(It,{label:m,block:t}),s.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1 ",children:[h&&s.jsxRuntimeExports.jsx(L.ArrowUpIcon,{className:"hover:scale-105 ",onClick:()=>{l([]),a([h])}}),o.canDuplicateBlock(p.get(t,"_type",""))?s.jsxRuntimeExports.jsx(L.CopyIcon,{className:"hover:scale-105 ",onClick:()=>i([t==null?void 0:t._id])}):null,o.canDeleteBlock(p.get(t,"_type",""))?s.jsxRuntimeExports.jsx(L.TrashIcon,{className:"hover:scale-105 ",onClick:()=>n([t==null?void 0:t._id])}):null]})]})},At=({model:e})=>{const[t]=o.useBrandingOptions(),[n]=o.useSelectedBlockIds(),[i]=o.useDarkMode(),[a]=o.useHighlightBlockId(),[l]=o.useSelectedStylingBlocks(),[u]=H.useAtom(o.draggedBlockIdAtom),{document:r,window:d}=se(),[x]=g.useState(r==null?void 0:r.getElementById("highlighted-block")),[h]=g.useState(r==null?void 0:r.getElementById("selected-block")),[m]=g.useState(r==null?void 0:r.getElementById("selected-styling-block")),[y]=g.useState(r==null?void 0:r.getElementById("dragged-block"));g.useEffect(()=>{i?r==null||r.documentElement.classList.add("dark"):r==null||r.documentElement.classList.remove("dark")},[i,r]);const B=p.get(t,"headingFont","DM Sans"),q=p.get(t,"bodyFont","DM Sans");return g.useEffect(()=>{const k=p.get(t,"primaryColor","#000"),A=p.get(t,"secondaryColor","#FFF"),D=Ze.tailwindcssPaletteGenerator({colors:[k,A],names:["primary","secondary"]});D.primary.DEFAULT=k,D.secondary.DEFAULT=A;const O=p.get(t,"roundedCorners","0");!d||!d.tailwind||(d.tailwind.config={darkMode:"class",theme:{fontFamily:{heading:[B],body:[q]},extend:{borderRadius:{global:`${O||"0"}px`},colors:D}},plugins:[d.tailwind.plugin.withOptions(({prefix:w="ui"}={})=>({addVariant:F})=>{for(const W of["open","checked","selected","active","disabled"])F(`${w}-${W}`,[`&[data-headlessui-state~="${W}"]`,`:where([data-headlessui-state~="${W}"]) &`]),F(`${w}-not-${W}`,[`&[data-headlessui-state]:not([data-headlessui-state~="${W}"])`,`:where([data-headlessui-state]:not([data-headlessui-state~="${W}"])) &:not([data-headlessui-state])`])})]})},[t,d,B,q]),g.useEffect(()=>{h&&(h.textContent=`${p.map(n,k=>`[data-block-id="${k}"]`).join(",")}{
|
|
56
|
-
outline: 1px solid ${n.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
|
|
57
|
-
}`)},[n,h]),g.useEffect(()=>{if(!u){y.textContent="";return}y.textContent=`[data-block-id="${u}"]{ pointer-events: none !important; opacity: 0.2 !important}`},[u]),g.useEffect(()=>{x&&(x.textContent=a?`[data-style-id="${a}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}`:"")},[a,n,x]),g.useEffect(()=>{m&&(m.textContent=`${p.map(l,({id:k})=>`[data-style-id="${k}"]`).join(",")}{
|
|
58
|
-
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
59
|
-
}`)},[l,m]),g.useEffect(()=>{const k=p.get(t,"bodyTextLightColor","#64748b"),A=p.get(t,"bodyTextDarkColor","#94a3b8"),D=p.get(t,"bodyBgLightColor","#FFFFFF"),O=p.get(t,"bodyBgDarkColor","#0f172a");r.body.className=`font-body antialiased text-[${k}] bg-[${D}] dark:text-[${A}] dark:bg-[${O}]`},[t,r,e]),e==="page"?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[B&&s.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${B.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),q&&B!==q&&s.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${q.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),B&&s.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${B}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Dt=e=>{const t={};return Object.keys(e).forEach(n=>{p.isString(e[n])&&e[n].startsWith(ee.SLOT_KEY)&&(t[n]=e[n].replace(ee.SLOT_KEY,"").split(","))}),t},_t=p.memoize(e=>{const t=e.replace(ee.STYLES_KEY,"").split(",");return Ge.twMerge(t[0],t[1])});function Ot(e,t){return p.get(e,`${t}_attrs`,{})}function qt(e){const t={};return Object.keys(e).forEach(n=>{if(p.isString(e[n])&&e[n].startsWith(ee.STYLES_KEY)){const i=_t(e[n]);t[n]={className:i,"data-style-prop":n,"data-block-parent":e._id,"data-style-id":`${n}-${e._id}`,...Ot(e,n)}}}),t}function Pt(e,t){const n=p.get(e,"_bindings",{});return p.isEmpty(n)?{...e}:(p.each(n,(i,a)=>{p.isString(i)&&p.get(t,i,null)&&(e[a]=p.get(t,i,null))}),e)}function pe({blocks:e}){const t=o.useAllBlocks(),n=g.useCallback(l=>qt(l),[]),[i]=G.useChaiExternalData(),[a]=o.useAtom(o.inlineEditingActiveAtom);return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:g.Children.toArray(e.map((l,u)=>{if(a===l._id)return null;const r=Dt(l),d={};p.isEmpty(r)||Object.keys(r).forEach(y=>{d[y]=g.Children.toArray(r[y].map(B=>s.jsxRuntimeExports.jsx(pe,{blocks:[p.find(t,{_id:B})]})))});const x=p.filter(t,{_parent:l._id});d.children=x.length?s.jsxRuntimeExports.jsx(pe,{blocks:x}):null;const h=Xe.getBlockComponent(l._type),m=p.get(h,"component",null);return p.isNull(m)?s.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${l==null?void 0:l._type} not registered -->`}):s.jsxRuntimeExports.jsx(g.Suspense,{children:g.createElement(m,{blockProps:{"data-block-id":l._id,"data-block-type":l._type,"data-dnd":o.canAddChildBlock(l._type)?"branch":"leaf"},inBuilder:!0,index:u,...Pt(l,i),...n(l),...d})})}))})}const Mt=()=>{const e=o.useAllBlocks();return s.jsxRuntimeExports.jsx(Qe.Provider,{children:p.isEmpty(e)?null:s.jsxRuntimeExports.jsx(G.BlocksExternalDataProvider,{children:s.jsxRuntimeExports.jsx(pe,{blocks:p.filter(e,t=>p.isEmpty(t._parent))})})})},Lt=(e,t)=>e.querySelector(`[data-style-id="${t}"]`),Nt=()=>{const[e]=H.useAtom(o.networkModeAtom),[t]=o.usePreviewMode(),[n]=o.useCanvasWidth(),[,i]=o.useSelectedBlockIds(),a=o.useSelectedBlock(),[,l]=o.useHighlightBlockId(),u=g.useRef(null),r=g.useRef(null),[d,x]=g.useState({width:0,height:0}),h=at(d),[m,y]=g.useState(0),[B,q]=g.useState([]),[,k]=g.useState([]),[,A]=H.useAtom(o.canvasIframeAtom),[D,O]=o.useSelectedStylingBlocks(),w=o.useBuilderProp("loadingCanvas",!1);g.useEffect(()=>{const{clientWidth:_,clientHeight:$}=r.current;x({width:_,height:$}),m===0&&y(_)},[r,n,m]);const F=(_,$=0)=>{const{top:U}=_.getBoundingClientRect();return U+$>=0&&U-$<=window.innerHeight};g.useEffect(()=>{var _,$;if(a&&a.type!=="Multiple"&&u.current){const U=qe(u.current.contentDocument,a._id);U&&(F(U)||($=(_=u.current)==null?void 0:_.contentWindow)==null||$.scrollTo({top:U.offsetTop,behavior:"smooth"}),q([U]))}},[a]),g.useEffect(()=>{if(!p.isEmpty(D)&&u.current){const _=Lt(u.current.contentDocument,p.first(D).id);k(_?[_]:[null])}else k([null])},[D]);const W=g.useMemo(()=>{let _=it;return e==="offline"&&(_=_.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),_=_.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),_=_.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),_},[e]);return s.jsxRuntimeExports.jsx("div",{onClick:()=>{i([]),O([])},onMouseLeave:()=>setTimeout(()=>l(""),300),className:"relative mx-auto overflow-hidden h-full w-full",style:m>0&&!p.isEmpty(h)?{width:t?"100%":m}:{},ref:r,children:s.jsxRuntimeExports.jsxs(gt,{contentDidMount:()=>A(u.current),ref:u,id:"canvas-iframe",style:{width:`${n}px`,...h},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:W,children:[s.jsxRuntimeExports.jsx(Tt,{}),s.jsxRuntimeExports.jsx(Bt,{block:a,selectedBlockElement:p.first(B)}),s.jsxRuntimeExports.jsx(At,{model:"page"}),s.jsxRuntimeExports.jsx(Ct,{children:w?s.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:s.jsxRuntimeExports.jsx(o.Skeleton,{className:"h-full"})}):s.jsxRuntimeExports.jsx(Mt,{})}),s.jsxRuntimeExports.jsx("br",{}),s.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"absolute bg-green-500 z-[99999] max-w-full transition-transform"})]})})},Ft=()=>s.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[s.jsxRuntimeExports.jsx(ot,{}),s.jsxRuntimeExports.jsx("div",{className:"relative h-full overflow-hidden bg-slate-800/90 px-2 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px]",children:s.jsxRuntimeExports.jsx(g.Suspense,{fallback:s.jsxRuntimeExports.jsx(o.Skeleton,{className:"h-full"}),children:s.jsxRuntimeExports.jsx(G.ErrorBoundary,{children:s.jsxRuntimeExports.jsx(Nt,{})})})})]});exports.default=Ft;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-IIJ_o44s.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-mUPP605-.cjs"),j=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");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-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const p=()=>{const{data:s}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:q}=t.useSavePage(),d=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&s.homepage&&!i.find(u,{uuid:n})&&a(s.homepage)},[n,u,s,a]),l.useEffect(()=>()=>a(null),[a]);const m=r=>{if(q!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});d(g)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),i.capitalize(s.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(t.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(t.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isEmpty as s, startsWith as f } from "lodash-es";
|
|
2
|
-
import { clsx as n } from "clsx";
|
|
3
|
-
import { twMerge as a } from "tailwind-merge";
|
|
4
|
-
function c(t = 6, r = "abcdefghijklmnopqrstuvwxyzABCD") {
|
|
5
|
-
let e = "";
|
|
6
|
-
for (let o = t; o > 0; --o)
|
|
7
|
-
e += r[Math.floor(Math.random() * r.length)];
|
|
8
|
-
return e;
|
|
9
|
-
}
|
|
10
|
-
const l = (t) => t >= 1536 ? "2XL" : t >= 1280 ? "XL" : t >= 1024 ? "LG" : t >= 768 ? "MD" : t >= 640 ? "SM" : "XS", i = (...t) => a(n(t));
|
|
11
|
-
export {
|
|
12
|
-
l as a,
|
|
13
|
-
i as c,
|
|
14
|
-
c as g
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("lodash-es"),o=require("clsx"),s=require("tailwind-merge");function c(e=6,t="abcdefghijklmnopqrstuvwxyzABCD"){let r="";for(let n=e;n>0;--n)r+=t[Math.floor(Math.random()*t.length)];return r}const a=e=>e>=1536?"2XL":e>=1280?"XL":e>=1024?"LG":e>=768?"MD":e>=640?"SM":"XS",l=(...e)=>s.twMerge(o.clsx(e));exports.cn=l;exports.generateUUID=c;exports.getBreakpointValue=a;
|
package/dist/Layers-EGhZWmvD.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("lodash-es"),s=require("@radix-ui/react-icons"),f=require("react-dnd"),y=require("@minoru/react-dnd-treeview"),M=require("react-i18next"),r=require("./index-IIJ_o44s.cjs"),N=require("lucide-react"),g=require("react"),O=require("./MODIFIERS-2FeVfZQ9.cjs"),B=require("./Functions-N3yhPYKY.cjs"),_=require("./index-mUPP605-.cjs"),A=require("./useAddBlockByDrop-_nd8yZBa.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("clsx");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-scroll-area");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-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const C=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(N.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function P(t=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const c=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(c);if(u.nth(l,1))return`Visible >=${n[u.nth(l,1)]}`}return""}const H=t=>{let n="";return Object.keys(t).forEach(o=>{u.startsWith(t[o],O.STYLES_KEY)&&(n=t[o])}),n},L=t=>{var R;const[,n]=r.useHighlightBlockId(),[o]=r.useHiddenBlockIds(),{isSelected:i}=t,{id:c,data:l}=t.node,d=t.depth*10,p=a=>{a.stopPropagation(),t.onToggle(t.node.id)},E=y.useDragOver(c,t.isOpen,t.onToggle),m=g.useMemo(()=>{const a=H(t.node.data);return P(a)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:B.cn("group flex w-full items-center justify-between space-x-px py-px ",i?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:a=>{a.stopPropagation(),!o.includes(c)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:d},...E,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:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:p,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(C,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((R=t.node.data)==null?void 0:R._name)||t.node.text}),m?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(i?"text-gray-200":"text-gray-500"),children:["(",m,")"]}):null]})]})})},F=t=>{var o;const{item:n}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(C,{type:(o=n==null?void 0:n.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:n.text})]})},V=t=>{const n=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:n}})},z=g.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-S2BhHTsK.cjs"))),G=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCutBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},$=()=>{const[t]=r.useSelectedBlockIds(),[,n]=r.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},K=()=>{const[t]=r.useSelectedBlockIds(),n=r.useRemoveBlocks(),o=r.useSelectedBlock();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{disabled:(o==null?void 0:o._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>n(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},Q=({id:t=null,openMarkAsGlobalModal:n})=>{const[o]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=r.usePasteBlocks(),d=r.useBuilderProp("globalBlocksSupport",!1),p=g.useCallback(()=>{i(o)},[o,i]);return e.jsxRuntimeExports.jsxs(r.ContextMenuContent,{className:"text-xs",children:[d&&e.jsxRuntimeExports.jsx(r.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:n,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:p,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(G,{}),e.jsxRuntimeExports.jsx($,{}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(K,{})]})},U=({children:t,id:n=null})=>{const[o,i]=g.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(r.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxRuntimeExports.jsx(r.DialogContent,{children:e.jsxRuntimeExports.jsx(g.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(z,{closeModal:()=>i(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(Q,{id:n,openMarkAsGlobalModal:()=>i(!0)})]})]})};function Y(t){return u.map(t,n=>{const{data:o}=n;return{...o,_parent:n.parent===0?null:n.parent}})}const W=()=>{const t=r.useAllBlocks(),[n]=r.useSetAllBlocks(),[o,i,c]=r.useSelectedBlockIds(),[,l]=r.useSelectedStylingBlocks(),{t:d}=M.useTranslation(),{createSnapshot:p}=r.useCanvasHistory(),E=_.useExpandedIds(),m=A.useAddBlockByDrop(),R=async(x,j)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:q}=j;if(h){p();const D=Y(x);n(D);const T=q.getItem();i([T.id])}else await m({block:q.getItem(),dropTargetId:k,relativeIndex:b})},a=u.map(t,x=>({id:x._id,text:x._type,parent:x._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:x._id})),data:x})),v=()=>{i([]),l([])},[{isOver:I},S]=f.useDrop(()=>({accept:["CHAI_BLOCK"],collect:x=>({canDrop:x.canDrop(),isOver:x.isOver()}),drop:x=>{(async()=>await m({block:x,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:w}=f.useDragLayer(x=>({isDragging:x.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>v(),className:B.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",w?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:S,className:`mx-1 mt-4 max-w-full h-full p-6 text-center text-sm text-gray-400 ${I?"bg-blue-200":""}`,children:[I?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(I?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(r.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(y.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:a,rootId:0,render:(x,{depth:j,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(U,{id:x.id,children:e.jsxRuntimeExports.jsx(L,{onSelect:k=>{l([]),i([k])},isSelected:u.includes(o,x.id),node:x,depth:j,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:x=>e.jsxRuntimeExports.jsx(F,{monitorProps:x}),onDrop:R,classes:{root:"h-full pt-2",draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:r.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(x,{depth:j})=>e.jsxRuntimeExports.jsx(V,{node:x,depth:j})})})})})};exports.default=W;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react-i18next"),c=require("@radix-ui/react-icons"),x=require("react"),i=require("./index-IIJ_o44s.cjs"),m=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");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-scroll-area");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-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");const q=({id:u=null,closeModal:t})=>{const{t:r}=o.useTranslation(),l=i.useMarkAsGlobalBlock(),[s,n]=x.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:r("mark_as_global")}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:[r("global_block_note"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:[r("global_block_indicator")," ",e.jsxRuntimeExports.jsx(c.GlobeIcon,{className:"inline"})]}),e.jsxRuntimeExports.jsx("li",{children:r("global_block_category")})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:r("enter_global_block_name")}),e.jsxRuntimeExports.jsx("input",{placeholder:r("eg_header_footer"),className:"mt-2 w-full",value:s,onChange:a=>n(a.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{l(u,m.capitalize(s)),t()},disabled:s.length<=2,variant:"default",children:r("mark_as_global")}),e.jsxRuntimeExports.jsx(i.Button,{variant:"outline",onClick:t,children:r("cancel")})]})]})};exports.default=q;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-mUPP605-.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-IIJ_o44s.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");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-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-o5dy8nwt.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-pJFW_LaN.cjs"))),d=()=>{const{data:t=[],isLoading:q}=s.usePages(),{data:r}=s.useProject(),n=i.sortBy(i.filter(t,{type:"STATIC"}),o=>i.get(o,"uuid")===(r==null?void 0:r.homepage)?0:1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Pages"}),e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(a,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(x,{isLoading:q,pages:n})})]})};exports.default=d;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-IIJ_o44s.cjs"),a=require("./index-mUPP605-.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");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-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-lNEoQK1n.cjs"))),q=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-9JGBPzcA.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function m(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(q,{_projectData:i,seany:o})})})]})]})})]})}exports.default=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var ae=Object.create;var K=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var xe=(s,n,r,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ue(n))!ce.call(s,i)&&i!==r&&K(s,i,{get:()=>n[i],enumerable:!(l=pe(n,i))||l.enumerable});return s};var me=(s,n,r)=>(r=s!=null?ae(de(s)):{},xe(n||!s||!s.__esModule?K(r,"default",{value:s,enumerable:!0}):r,s));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),m=require("react"),z=require("@react-hookz/web"),t=require("lodash-es"),A=require("react-i18next"),d=require("@radix-ui/react-icons"),o=require("./index-IIJ_o44s.cjs"),ge=require("./controls-Dy1qa8Dc.cjs"),Y=require("lucide-react"),Z=require("@chaibuilder/runtime"),q=require("./index-mUPP605-.cjs"),ye=require("@rjsf/core"),he=require("@rjsf/validator-ajv8"),be=require("jotai"),fe=require("react-autosuggest"),je=require("fuse.js"),B=require("./utils-PTxFk6qT.cjs"),ve=require("./MODIFIERS-2FeVfZQ9.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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-scroll-area");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-dom");require("react-quill");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("redux-undo");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");function Re(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:()=>s[r]})}}return n.default=s,Object.freeze(n)}const M=Re(m),Ee=m.lazy(()=>import("react-json-view"));function we(s){const n=[],r={};function l(i,c){t.forEach(c,(a,x)=>{const u=i?`${i}.${x}`:x,g=t.isArray(a)?"list":typeof a;n.push(u),r[u]=g==="string"?"text":g==="object"?"model":g,g==="object"&&!t.isArray(a)&&l(u,a)})}return l("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:n,pathsType:r}}const F=({data:s,fullView:n})=>{if(!s)return null;const r=typeof s;return n?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(Ee,{style:{maxHeight:"40vh",overflowY:"auto"},name:"Content",enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:s,collapsed:!0})})]}):e.jsxRuntimeExports.jsxs("div",{className:"text-gray-800/50 text-[12px] leading-4 w-full max-h-36 overflow-x-hidden overflow-y-auto",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},G=({type:s,value:n="",setValue:r,data:l,onChange:i,dataType:c,appliedBindings:a})=>{const{paths:x,pathsType:u}=we(l),g=s==="PROP"?Z.getBlockComponent(l==null?void 0:l._type):{},f=s==="PROP",[p,b]=m.useState(!1),h=m.useMemo(()=>s==="PROP"?x.filter(y=>!t.includes(a,y)&&t.get(g,`props.${t.first(t.split(y,"."))}.binding`)):x.filter(y=>c===t.get(u,y,"")),[s,x,a,c,g]);return m.useEffect(()=>{n&&i(n)},[n,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:p,onOpenChange:b,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(n)?"bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white w-44 justify-center":"min-w-[350px] justify-between items-center"}`,children:n?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"text-sm pr-8",children:[f&&e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 mr-2 rounded-full",children:t.startCase(c)}),n]}),e.jsxRuntimeExports.jsx("span",{className:"text-[9px] text-blue-400 underline cursor-pointer hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{className:"p-0 z-[999] min-w-[300px]",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(h,y=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:y,className:`cursor-pointer ${f?"flex justify-between items-center":"flex flex-col items-start justify-start"}`,onSelect:v=>{r(t.find(h,w=>w===v)||null),b(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(Y.Check,{className:`w-4 h-4 text-green-500 ${n===y?"":"opacity-0"}`}),y]}),f?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"text-[10px] text-purple-500 bg-purple-100 px-2 py-0.5 rounded-full",children:t.startCase(t.get(u,y,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(F,{data:t.get(l,y)})})]},y))})]})]})})]})]}),!f&&!t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(F,{data:t.get(l,n,""),fullView:!0})})]})},Ce=({appliedBindings:s=[],onAddBinding:n,editMode:r,item:l})=>{const[i,c]=m.useState(r?l.key:""),[a,x]=m.useState(r?l.value:""),u=o.useSelectedBlock(),[g]=q.useChaiExternalData(),f=m.useCallback((h,y)=>{if(t.isEmpty(h))return"";{const v=t.get(y==="PROP"?u:g,h,"");if(t.isArray(v))return"list";const w=typeof v;return w==="string"?"text":w==="object"?"model":w}},[u,g]),[p,b]=m.useState(r?f(l.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 relative",children:[e.jsxRuntimeExports.jsx(G,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:c,onChange:h=>{const y=f(h,"PROP");c(h),p!==y&&x(""),b(y)},data:u,dataType:p,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(G,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:a,setValue:x,onChange:h=>{const y=f(h,"PATH");x(p===y?h:"")},data:g,dataType:p,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(a),onClick:()=>n({key:i,value:a}),children:"Save"})})]})},re=({disabled:s,children:n,onAddBinding:r,appliedBindings:l,editMode:i=!0,item:c={}})=>{const[a,x]=m.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:s,asChild:!0,onClick:()=>x(!0),children:n}),a&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(Ce,{item:c,editMode:i,appliedBindings:l,onAddBinding:u=>{r(u),x(!1)}})})]})},ke=({item:s,onAddBinding:n,onRemove:r,selectedBlock:l,dataProvider:i,appliedBindings:c})=>{const[a,x]=m.useState("string"),u=(g,f)=>{if(t.isEmpty(g))return"";{const p=t.get(f==="PROP"?l:i,g,"");if(t.isArray(p))return"list";const b=typeof p;return b==="string"?"text":b==="object"?"model":b}};return m.useEffect(()=>x(()=>u(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col border border-gray-200 relative rounded-md p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-gray-500 font-normal text-sm",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(F,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(re,{editMode:!0,onAddBinding:n,appliedBindings:c,item:s,children:e.jsxRuntimeExports.jsx(Y.EditIcon,{className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-blue-400 hover:text-white border-blue-400 p-1 text-blue-400 hover:scale-105 duration-200"})}),e.jsxRuntimeExports.jsx(Y.TrashIcon,{onClick:()=>r(),className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"})]}),!t.isEmpty(a)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"mt-px absolute right-0 top-1 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(a)})]})},Ne=({bindingData:s,onChange:n})=>{const r=o.useSelectedBlock(),[l]=q.useChaiExternalData(),i=Z.getChaiDataProviders(),[c,a]=m.useState(t.map(s,(p,b)=>({key:b,value:p})));m.useEffect(()=>{a(t.map(s,(p,b)=>({key:b,value:p})))},[r==null?void 0:r._id]);const x=m.useMemo(()=>{if(t.isEmpty(l))return!0;if(t.isEmpty(c))return!1;const p=t.last(c);return t.isEmpty(p==null?void 0:p.key)||t.isEmpty(p==null?void 0:p.value)},[l,c]),u=p=>{const b=t.filter(c,h=>h.key!==p.key);a([...b,p]),f([...b,p])},g=p=>{const b=t.filter(c,(h,y)=>p!==y);f([...b])},f=m.useCallback((p=[])=>{if(a(p),t.isEmpty(p)){n({});return}const b={};t.forEach(p,h=>{!t.isEmpty(h==null?void 0:h.key)&&!t.isEmpty(h==null?void 0:h.value)&&t.set(b,h.key,h.value)}),n(b)},[n]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(c,(p,b)=>e.jsxRuntimeExports.jsx(ke,{item:p,onAddBinding:u,onRemove:()=>g(b),selectedBlock:r,dataProvider:l,appliedBindings:t.map(c,"key")},p.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(re,{disabled:x,appliedBindings:t.map(c,"key"),onAddBinding:u,children:e.jsxRuntimeExports.jsx("span",{className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${x?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(l)?e.jsxRuntimeExports.jsx("small",{className:"text-gray-500 text-[9.5px]",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),x&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(l)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},Se=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),O=m.memo(({createHistorySnapshot:s,properties:n,formData:r,onChange:l})=>{const i={type:"object",properties:{}},c={};return Object.keys(n).forEach(a=>{const x=n[a];if(t.includes(["slot","styles"],x.type))return;const u=a;i.properties[u]=o.getBlockJSONFromSchemas(x),c[u]=o.getBlockJSONFromUISchemas(x)}),e.jsxRuntimeExports.jsx(ye,{widgets:{binding:Se,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator:he,uiSchema:c,onBlur:s,schema:i,formData:r,onChange:l})});function Te(){const s=o.useSelectedBlock(),{createSnapshot:n}=o.useCanvasHistory(),r=o.useUpdateBlocksPropsRealtime(),l=Z.getBlockComponent(s._type),i={...s},c=o.useBuilderProp("dataBindingSupport",!1),a=()=>n(),x=({formData:p},b)=>{if(b){const h=b.replace("root.","");r([s._id],{[h]:t.get(p,h)})}},u={_name:ge.u({title:"Name",default:t.get(s,"_name",s._type)})},g=t.keys(t.get(i,"_bindings",{})),f=m.useMemo(()=>{const p=t.cloneDeep(t.get(l,"props",{}));return c&&t.each(g,b=>delete p[b]),p},[l,g,c]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(O,{onChange:x,createHistorySnapshot:a,formData:i,properties:u}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),c?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Ne,{bindingData:t.get(i,"_bindings",{}),onChange:p=>{x({formData:{...i,_bindings:p}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(g)?null:e.jsxRuntimeExports.jsxs("div",{className:"text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(g,t.capitalize).join(", ")})," ",g.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(O,{onChange:x,createHistorySnapshot:a,formData:i,properties:f})]})]})]}):e.jsxRuntimeExports.jsx(O,{onChange:x,createHistorySnapshot:a,formData:i,properties:f}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const J=new je(B.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function Ie(){var I;const[s]=o.useSelectedStylingBlocks(),n=o.useSelectedBlock(),r=o.useAddClassesToBlocks(),l=o.useRemoveClassesFromBlocks(),[i]=o.useSelectedBlockIds(),[c,a]=m.useState(""),x=(I=t.first(s))==null?void 0:I.prop,u=t.reject((t.get(n,x,"").replace(ve.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),g=()=>{const E=c.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,E,!0),a("")},[f,p]=m.useState([]),b=({value:E})=>{const T=E.trim().toLowerCase(),_=T.match(/.+:/g);let C=[];if(_&&_.length>0){const[S]=_,V=T.replace(S,"");C=J.search(V).map(j=>({...j,item:{...j.item,name:S+j.item.name}}))}else C=J.search(T);p(t.map(C,"item"))},h=()=>{p([])},y=E=>E.name,v=E=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:E.name}),w={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:c,onKeyDown:E=>{E.key==="Enter"&&c.trim()!==""&&g()},onChange:(E,{newValue:T})=>a(T),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${f.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(fe,{suggestions:f,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:h,getSuggestionValue:y,renderSuggestion:v,inputProps:w,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:g,disabled:c.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(d.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(u)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),M.Children.toArray(u.map(E=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[E,e.jsxRuntimeExports.jsx(d.Cross2Icon,{onClick:()=>l(i,[E]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},E)))]})]})}const N=["px","%","em","rem","ch","vh","vw"],_e={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:N,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},He={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},Ve=[{heading:"layout.heading",items:[{type:"arbitrary",label:"layout.width",units:N.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:N.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...N,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"multiple",label:"layout.space_bt",options:[{key:"spaceX",label:"layout.space_lr"},{key:"spaceY",label:"layout.space_tb"}]}]},{heading:"size.heading",items:[{styleType:"accordion",heading:"size.min_width_height",items:[{type:"arbitrary",label:"size.min_width",units:N.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"size.min_height",units:N.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"size.max_width_height",items:[{type:"arbitrary",label:"size.max_width",units:N.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"size.max_height",units:N.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"size.object_options_aspect_ratio",items:[{type:"dropdown",label:"size.aspect",property:"aspectRatio"},{type:"dropdown",label:"size.fit",property:"objectFit"},{type:"dropdown",label:"size.position",property:"objectPosition"}]}]},{heading:"display.heading",items:[{type:"dropdown",label:"display.display",property:"display",units:N},{styleType:"accordion",heading:"display.flex_options",items:[{type:"dropdown",label:"display.flex_direction",property:"flexDirection"},{type:"dropdown",label:"display.flex_wrap",property:"flexWrap"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"display.grid_options",items:[{type:"range",label:"display.grid_columns",property:"gridColumns"},{type:"range",label:"display.grid_rows",property:"gridRows"},{type:"dropdown",label:"display.grid_auto_flow",property:"gridAutoFlow"},{type:"dropdown",label:"display.grid_auto_cols",property:"gridAutoColumns"},{type:"dropdown",label:"display.grid_auto_rows",property:"gridAutoRows"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",units:["px","rem"],options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"display.visibility_opacity",items:[{type:"dropdown",label:"display.visibility",property:"visibility",units:N},{type:"arbitrary",label:"display.opacity",property:"opacity",units:["-"]}]}]},{heading:"position.heading",items:[{type:"icons",label:"position.position",property:"position"},{styleType:"accordion",heading:"position.options",items:[{styleType:"multiple",label:"position.direction",options:[{key:"top",label:"position.top"},{key:"right",label:"position.right"},{key:"bottom",label:"position.bottom"},{key:"left",label:"position.left"}]},{styleType:"multiple",label:"position.inset",options:[{key:"inset",label:"position.all"},{key:"insetX",label:"position.lr"},{key:"insetY",label:"position.tb"}]},{type:"arbitrary",label:"position.z_index",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"position.float_clear",items:[{type:"icons",label:"position.float",property:"float"},{type:"dropdown",label:"position.clear",property:"clear"}]},{styleType:"accordion",heading:"position.overflow_overscroll",items:[{styleType:"multiple",type:"dropdown",label:"position.overflow",options:[{key:"overflow",label:"position.all"},{key:"overflowX",label:"position.lr"},{key:"overflowY",label:"position.tb"}]},{styleType:"multiple",type:"dropdown",label:"position.overscroll",options:[{key:"overscroll",label:"position.all"},{key:"overscrollX",label:"position.lr"},{key:"overscrollY",label:"position.tb"}]}]}]},{heading:"typography.heading",items:[{type:"dropdown",property:"typography.font",label:"typography.font"},{type:"arbitrary",property:"typography.size",label:"typography.size",units:N},{type:"arbitrary",property:"typography.height",label:"typography.height",units:N.concat("-")},{type:"range",property:"typography.weight",label:"typography.weight"},{type:"color",property:"typography.color",label:"typography.color"},{styleType:"accordion",heading:"typography.alignments",items:[{type:"dropdown",property:"typography.align",label:"typography.align"},{type:"dropdown",property:"typography.valign",label:"typography.valign"}]},{styleType:"accordion",heading:"typography.spacing_decoration_more",items:[{type:"dropdown",property:"typography.spacing",label:"typography.spacing"},{type:"dropdown",property:"typography.decoration",label:"typography.decoration"},{type:"range",property:"typography.thickness",label:"typography.thickness"},{type:"dropdown",property:"typography.transform",label:"typography.transform"}]},{styleType:"accordion",heading:"typography.whitespace_breaks",items:[{type:"dropdown",property:"typography.whitespace",label:"typography.whitespace"},{type:"dropdown",property:"typography.wordbreak",label:"typography.wordbreak"}]}]},{heading:"background.heading",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{styleType:"accordion",heading:"background.position_size_more",items:[{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]},{type:"dropdown",label:"background.gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"background.gradient_colors",items:[{type:"color",label:"background.from_color",property:"fromColor"},{type:"color",label:"background.via_color",property:"viaColor"},{type:"color",label:"background.to_color",property:"toColor"}]}]},{heading:"border.heading",items:[{styleType:"multiple",type:"dropdown",label:"border.width",options:[{key:"border",label:"border.all"},{key:"borderX",label:"border.lr"},{key:"borderY",label:"border.tb"},{key:"borderTop",label:"border.top"},{key:"borderRight",label:"border.right"},{key:"borderBottom",label:"border.bottom"},{key:"borderLeft",label:"border.left"}]},{styleType:"multiple",type:"dropdown",label:"border.corners",options:[{key:"borderRadius",label:"border.all"},{key:"borderRadiusTop",label:"border.top"},{key:"borderRadiusRight",label:"border.right"},{key:"borderRadiusBottom",label:"border.bottom"},{key:"borderRadiusLeft",label:"border.left"},{key:"borderRadiusTopLeft",label:"border.top_left"},{key:"borderRadiusTopRight",label:"border.top_right"},{key:"borderRadiusBottomRight",label:"border.bottom_right"},{key:"borderRadiusBottomLeft",label:"border.bottom_left"}]},{type:"color",label:"border.color",property:"borderColor"},{type:"dropdown",label:"border.style",property:"borderStyle"},{styleType:"accordion",heading:"border.divide_options",items:[{styleType:"multiple",type:"range",label:"border.width",options:[{key:"divideXWidth",label:"border.lr"},{key:"divideYWidth",label:"border.tb"}]},{type:"color",label:"border.divide_color",property:"divideColor"},{type:"dropdown",label:"border.divide_style",property:"divideStyle"}]},{styleType:"accordion",heading:"border.outline_styling",items:[{type:"range",label:"border.outline_width",property:"outlineWidth"},{type:"range",label:"border.outline_offset",property:"outlineOffset"},{type:"dropdown",label:"border.outline_style",property:"outlineStyle"}]},{styleType:"accordion",heading:"border.ring_options",items:[{type:"range",label:"border.ring_width",property:"ringWidth"},{type:"color",label:"border.ring_color",property:"ringColor"},{type:"range",label:"border.ring_offset_width",property:"ringOffsetWidth"},{type:"color",label:"border.ring_offset_color",property:"ringOffsetColor"}]}]},{heading:"effect.heading",items:[{type:"range",label:"effect.shadow",property:"boxShadow"},{type:"color",label:"effect.color",property:"boxShadowColor"},{type:"dropdown",label:"effect.cursor",property:"cursor"},{styleType:"accordion",heading:"effect.blend_cursor",items:[{type:"dropdown",label:"effect.mix_blend",property:"mixBlendMode"},{type:"dropdown",label:"effect.bg_blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"effect.transform",items:[{type:"dropdown",label:"effect.origin",property:"transformOrigin"},{styleType:"multiple",label:"effect.scale",units:["-"],options:[{key:"scale",label:"effect.all"},{key:"scaleX",label:"effect.lr"},{key:"scaleY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.skew",units:["deg"],options:[{key:"skewX",label:"effect.lr"},{key:"skewY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.translate",negative:!0,options:[{key:"translateX",label:"effect.lr"},{key:"translateY",label:"effect.tb"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"effect.rotate",property:"rotate"}]},{styleType:"accordion",heading:"effect.animation",items:[{type:"dropdown",label:"effect.animation",property:"animation"},{type:"dropdown",label:"effect.transition",property:"transition"},{type:"dropdown",label:"effect.easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"effect.duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"effect.delay",property:"delay"}]}]},{heading:"classes.heading",items:[{component:Ie}]}],se={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:d.EyeOpenIcon,invisible:d.EyeClosedIcon,hidden:d.EyeClosedIcon,gap:d.BorderAllIcon,gapX:d.WidthIcon,gapY:d.HeightIcon,spaceX:d.WidthIcon,spaceY:d.HeightIcon,overscroll:d.BorderAllIcon,overscrollX:d.WidthIcon,overscrollY:d.HeightIcon,overflow:d.BorderAllIcon,overflowX:d.WidthIcon,overflowY:d.HeightIcon,top:d.ArrowUpIcon,right:d.ArrowRightIcon,bottom:d.ArrowDownIcon,left:d.ArrowLeftIcon,inset:d.BorderAllIcon,insetX:d.WidthIcon,insetY:d.HeightIcon,border:d.BorderAllIcon,borderX:d.WidthIcon,borderY:d.HeightIcon,borderTop:d.ArrowUpIcon,borderRight:d.ArrowRightIcon,borderBottom:d.ArrowDownIcon,borderLeft:d.ArrowLeftIcon,borderRadius:d.BorderAllIcon,borderRadiusX:d.WidthIcon,borderRadiusY:d.HeightIcon,borderRadiusTop:d.ArrowUpIcon,borderRadiusRight:d.ArrowRightIcon,borderRadiusBottom:d.ArrowDownIcon,borderRadiusLeft:d.ArrowLeftIcon,borderRadiusTopLeft:d.ArrowTopLeftIcon,borderRadiusTopRight:d.ArrowTopRightIcon,borderRadiusBottomRight:d.ArrowBottomRightIcon,borderRadiusBottomLeft:d.ArrowBottomLeftIcon,divideXWidth:d.WidthIcon,divideYWidth:d.HeightIcon,scale:d.BorderAllIcon,scaleX:d.WidthIcon,scaleY:d.HeightIcon,skewX:d.WidthIcon,skewY:d.HeightIcon,translateX:d.WidthIcon,translateY:d.HeightIcon,padding:d.BorderAllIcon,paddingX:d.WidthIcon,paddingY:d.HeightIcon,paddingTop:d.ArrowUpIcon,paddingRight:d.ArrowRightIcon,paddingBottom:d.ArrowDownIcon,paddingLeft:d.ArrowLeftIcon,margin:d.BorderAllIcon,marginX:d.WidthIcon,marginY:d.HeightIcon,marginTop:d.ArrowUpIcon,marginRight:d.ArrowRightIcon,marginBottom:d.ArrowDownIcon,marginLeft:d.ArrowLeftIcon,textLeft:d.AlignLeftIcon,textCenter:d.AlignCenterHorizontallyIcon,textRight:d.AlignRightIcon,textJustify:d.StretchHorizontallyIcon,italic:d.FontItalicIcon,underline:d.UnderlineIcon,overline:d.OverlineIcon,uppercase:d.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":d.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:d.Cross1Icon},$=m.createContext({canReset:!1,canChange:!0}),Ae=({children:s,canReset:n=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx($.Provider,{value:{canReset:n,canChange:r},children:s}),oe=({label:s,property:n,onChange:r})=>{const l=m.useMemo(()=>t.get(B.CLASSES_LIST,`${n}.classes`,[""]),[n]),i=L(n),c=m.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:a}=m.useContext($),x=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded ":"grow",children:x?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(X,{rounded:s,onChange:u=>r(u,n),selected:c,options:l,disabled:!a})})};function X({selected:s,onChange:n,rounded:r=!1,options:l,disabled:i=!1}){const c=s.replace(/.*:/g,"").trim(),{undo:a,redo:x}=o.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!l.length||i,className:`${r?"rounded-md border border-border":"border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:u=>n(u.target.value),onKeyDown:u=>{u.ctrlKey&&(u.key==="z"&&a(),u.key==="y"&&x())},value:c,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),m.Children.toArray(l.map(u=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:u,children:u})))]})}const Be=({property:s,onChange:n})=>{const{canReset:r,canChange:l}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]),a=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),x=a.indexOf(c)>-1?a.indexOf(c):0,u=/\[.*\]/g.test(c);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:u?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:c}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!l&&(!r||x-1<0),onClick:()=>n(t.nth(a,x-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(d.MinusIcon,{className:!l&&(!r||x-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(oe,{label:!1,property:s,onChange:n})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!l&&(!r||x+1>=a.length),onClick:()=>n(t.nth(a,x+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(d.PlusIcon,{className:!l&&(!r||x+1>=a.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},De=({property:s,onChange:n})=>{const r=m.useMemo(()=>t.get(B.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:l}=m.useContext($),i=L(s),c=m.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,a=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!l,onClick:()=>n(a,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${c===a?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:m.createElement(t.get(se,a,d.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(a))})]}))})},Pe={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},$e=({property:s,onChange:n})=>{const r=L(s),l=m.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=m.useContext($),[c,a]=m.useState([]),[x,u]=m.useState({color:"",shade:""}),g=l.split("-"),f=t.get(g,"1",""),p=t.get(g,"2",""),b=m.useCallback(y=>{["current","inherit","transparent","black","white"].includes(y)?(a([]),u({color:y})):(a(["50","100","200","300","400","500","600","700","800","900"]),u(v=>({...v,color:y,shade:v.shade?v.shade:"500"})))},[a,u]);m.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(f))return a([]);a(["50","100","200","300","400","500","600","700","800","900"])},[f]);const h=m.useCallback(y=>{u({color:f,shade:y})},[f]);return m.useEffect(()=>{u({color:"",shade:""})},[r]),m.useEffect(()=>{const v=`${t.get(Pe,s,"")}-${x.color}${x.shade?`-${x.shade}`:""}`;v.match(new RegExp(t.get(B.CLASSES_LIST,`${s}.regExp`,"")))&&n(v,s)},[x,n,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(X,{disabled:!i,rounded:!0,selected:f,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(X,{rounded:!0,selected:p,disabled:!f||!i,onChange:h,options:c})})]})},Q=(s,n)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&n.includes(r))return{value:"",unit:r};const l=n.length?new RegExp(n.join("|"),"g"):/XXXXXX/g;r=r.replace(l,"");const i=s.match(l),c=i&&i.length>1,a=!t.isEmpty(r)&&Number.isNaN(Number(r));return c||a?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}};const Le=s=>{const n=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${n}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${n}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const l=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(l)return{value:l[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[l,i]=t.map(r.split("/"),c=>parseInt(c,10));return{value:n+(l/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${n+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}};const Me=s=>{if(t.isEmpty(s))return{value:"",unit:""};const n=s.match(/\[.*\]/g);if(n===null)return qe(s);const r=t.get(n,"0","").replace(/\[|\]/g,""),l=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${l}${i}`,unit:r.replace(i,"")}},qe=s=>t.isEmpty(s)?{value:"",unit:""}:Le(s),ne=m.createContext({setDragData:()=>{}}),Oe=({unit:s,currentValue:n,onDrag:r,onDragEnd:l,onDragStart:i,negative:c,cssProperty:a})=>{const{setDragData:x}=m.useContext(ne);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:u=>{const g={onDrag:r,onDragEnd:l,dragging:!0,dragStartY:u.pageY,dragStartValue:`${n}`,dragUnit:s,negative:c,cssProperty:a};i(g),x(g)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(d.RowSpacingIcon,{})})},We=({onSelect:s,current:n,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(l=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:n===l?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(l)},children:l},l))}),ee=50,ze=s=>{const[n,r]=m.useState(!1),[l,i]=m.useState(""),{currentClass:c,onChange:a,classPrefix:x,cssProperty:u,units:g,negative:f}=s,[p,b]=m.useState(u!=null&&u.toLowerCase().includes("width")?"%":g[0]),[h,y]=m.useState(!1),[v,w]=m.useState(""),[I,E]=m.useState(!1),[T,_]=m.useState(!1);m.useEffect(()=>{const{value:j,unit:R}=Me(c);if(R===""){i(j),b(u!=null&&u.toLowerCase().includes("width")?"%":t.first(g));return}b(R),i(R==="class"||t.isEmpty(j)?"":j)},[c,u,g]);const C=z.useThrottledCallback(j=>a(j),[a],ee),S=z.useThrottledCallback(j=>a(j,!1),[a],ee),V=m.useCallback((j=!1)=>{const R=Q(`${l}`,g);if(t.get(R,"error",!1)){y(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):p;if(k==="auto"||k==="none"){C(`${x}${k}`);return}if(t.get(R,"value")==="")return;const P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;j?S(P):C(P)},[C,S,l,p,x,g]),D=m.useCallback(j=>{const R=Q(`${l}`,g);if(t.get(R,"error",!1)){y(!0);return}if(j==="auto"||j==="none"){C(`${x}${j}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):j,P=`${t.get(R,"value","").startsWith("-")?"-":""}${x}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;C(P)},[C,l,x,g]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:p==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:c}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${I?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(p)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:p==="class",onKeyPress:j=>{j.key==="Enter"&&V()},onKeyDown:j=>{if(j.keyCode!==38&&j.keyCode!==40)return;j.preventDefault(),_(!0);const R=t.parseInt(j.target.value);let k=t.isNaN(R)?0:R;j.keyCode===38&&(k+=1),j.keyCode===40&&(k-=1);const H=`${k}`,le=`${H.startsWith("-")?"-":""}${x}[${H.replace("-","")}${p==="-"?"":p}]`;S(le)},onKeyUp:j=>{T&&(j.preventDefault(),_(!1))},onBlur:()=>V(),onChange:j=>{y(!1),i(j.target.value)},onClick:j=>{var R;(R=j==null?void 0:j.target)==null||R.select(),r(!1)},value:I?v:l,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",h?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:n,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${g.length===1?"px-2 font-semibold":""}`,children:p}),g.length>1?e.jsxRuntimeExports.jsx(d.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(We,{units:g,current:p,onSelect:j=>{r(!1),b(j),D(j)}})})})]})]}),["none","auto"].indexOf(p)!==-1||I?null:e.jsxRuntimeExports.jsx(Oe,{onDragStart:()=>E(!0),onDragEnd:j=>{if(w(()=>""),E(!1),t.isEmpty(j))return;const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${p==="-"?"":p}]`;C(H)},onDrag:j=>{if(t.isEmpty(j))return;w(j);const R=`${j}`,H=`${R.startsWith("-")?"-":""}${x}[${R.replace("-","")}${p==="-"?"":p}]`;S(H)},currentValue:l,unit:p,negative:f,cssProperty:u})]})})})},L=s=>{const n=o.useSelectedBlockCurrentClasses();return t.findLast(n,{property:s})},Ye=(s,n)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[n]},Fe={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Xe=s=>`${s.toUpperCase()} ${te[s]?`(${te[s]} & up)`:""}`,U=s=>{const{t:n}=A.useTranslation(),{type:r="icons",label:l,property:i,onEmitChange:c=()=>{},units:a,negative:x=!1}=s,[u]=o.useDarkMode(),[g]=o.useStylingState(),[,f]=o.useCanvasWidth(),p=L(i),b=o.useAddClassesToBlocks(),h=o.useRemoveClassesFromBlocks(),[y]=o.useSelectedBlockIds(),v=m.useMemo(()=>t.get(p,"fullCls",""),[p]),w=m.useCallback((S,V=!0)=>{const D={dark:u,mq:f,mod:g,cls:S,property:i,fullCls:""};(u||g!=="")&&(D.mq="xs");const j=B.generateFullClsName(D);b(y,[j],V)},[y,u,f,g,i,b]),I=m.useCallback(()=>{h(y,[v])},[y,v,h]),E=m.useMemo(()=>Ye(p,f),[p,f]);m.useEffect(()=>{c(E,p)},[E,c,p]);const[,,T]=o.useCanvasWidth(),_=m.useCallback(S=>{T({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[S])},[T]),C=t.get(p,"dark",null)===u&&t.get(p,"mod",null)===g&&t.get(p,"mq",null)===f;return e.jsxRuntimeExports.jsx(Ae,{canChange:E,canReset:p&&C,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${p&&!C?"text-foreground":""}`,children:n(l)})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[r==="arbitrary"?e.jsxRuntimeExports.jsx(ze,{currentClass:t.get(p,"cls",""),classPrefix:t.get(Fe,i,""),units:a||[],onChange:w,negative:x,cssProperty:i}):null,r==="icons"&&e.jsxRuntimeExports.jsx(De,{property:i,onChange:w}),r==="range"&&e.jsxRuntimeExports.jsx(Be,{property:i,onChange:w}),r==="color"&&e.jsxRuntimeExports.jsx($e,{property:i,onChange:w}),r==="dropdown"&&e.jsxRuntimeExports.jsx(oe,{label:l,property:i,onChange:w})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${v?"visible":"invisible"}`,children:C?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>I(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(d.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):E&&p?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(d.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[Xe(t.get(p,"mq")),u&&!p.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>_(t.get(p,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(p,"mq").toUpperCase()]})]})})})]}):null})]})]})})},Ze=["px","%","em","rem","ch","vh","vw"],ie=({label:s,options:n,borderB:r=!1,borderT:l=!1,type:i="arbitrary",units:c=Ze,negative:a=!1})=>{const{t:x}=A.useTranslation(),[u,g]=m.useState(n[0].key),f=o.useSelectedBlockCurrentClasses(),p=m.useCallback(b=>t.map(f,"property").includes(b),[f]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${l?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:x(s)}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:m.Children.toArray(n.map(({label:b,key:h})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>g(h),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${h===u?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[m.createElement("div",{className:p(h)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),m.createElement(t.get(se,h,d.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(b))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(U,{type:i,units:[...c],label:"",property:u,negative:a})})]})},Ue=({heading:s,items:n})=>{const{t:r}=A.useTranslation(),l=o.useSelectedBlockCurrentClasses(),i=m.useMemo(()=>{const c=u=>t.flatten(u.map(g=>g.styleType==="multiple"?t.map(g.options,"key"):g.property)),a=t.flatten(n.map(u=>u.styleType==="accordion"?c(u.items):u.styleType==="multiple"?t.map(u.options,"key"):u.property)),x=t.map(l,"property");return t.intersection(a,x).length>0},[l,n]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r(s),i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:n.map(c=>c.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...c},c.label):e.jsxRuntimeExports.jsx(U,{...c},c.label))})]})},Ke=m.createContext({}),W=({section:s})=>{const{t:n}=A.useTranslation(),r=o.useSelectedBlockCurrentClasses(),l=m.useCallback((a=[])=>{const x={};for(let g=0;g<r.length;g++)x[r[g].property]=r[g].cls;let u=!0;for(const g in a)if(!t.has(x,g)||x[g]!==a[g]){u=!1;break}return u},[r]),i=m.useMemo(()=>{if(r.length>0&&s.heading==="classes.heading")return!0;const a=g=>t.flatten(g.map(f=>f.styleType==="multiple"?t.flatten(t.map(f.options,"key")):f.property)),x=t.flatten(s.items.map(g=>g.styleType==="accordion"?a(g.items):g.styleType==="multiple"?t.flatten(t.map(g.options,"key")):g.property)),u=t.map(r,"property");return t.intersection(x,u).length>0},[r,s.heading,s.items]),c=m.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Ke.Provider,{value:c,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),n(s.heading)]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:m.Children.toArray(s.items.map(a=>t.has(a,"component")?m.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...a},a.label):a.styleType==="accordion"&&l(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(Ue,{...a},a.label):null:e.jsxRuntimeExports.jsx(U,{...a},a.label)))})]})})},Ge=({item:s,index:n,canDelete:r,onChange:l,onRemove:i})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${r?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:c=>l(c,n),value:s.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:c=>t.isEmpty(s.key)?{}:l(c,n),value:s.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(d.TrashIcon,{onClick:i,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),Je=({section:s})=>{var b;const{setSyncState:n}=o.useSavePage(),r=o.useSelectedBlock(),[l,i]=m.useState([]),[c]=o.useSelectedStylingBlocks(),a=o.useUpdateBlocksPropsRealtime(),x=`${t.get(c,"0.prop")}_attrs`;M.useEffect(()=>{const h=t.map(t.get(r,x),(y,v)=>({key:v,value:y}));t.isEmpty(h)?i([]):i(h)},[t.get(r,x)]);const u=()=>i([...l,{key:"",value:""}]),g=h=>{const y=t.filter(l,(v,w)=>h!==w);p(y)},f=(h,y)=>{const v=[...l];v[y][h.target.name]=h.target.value,p(v)},p=M.useCallback((h=[])=>{const y={};t.forEach(h,v=>{t.isEmpty(v.key)||t.set(y,v.key,v.value)}),a([t.get(r,"_id")],{[x]:y}),n("UNSAVED")},[r,n,a,x]);return e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,x))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(o.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(l)&&t.isEmpty((b=t.last(l))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var h;!t.isEmpty(l)&&t.isEmpty((h=t.last(l))==null?void 0:h.key)||u()},children:[e.jsxRuntimeExports.jsx(d.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(l)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),M.Children.toArray(t.map(l,(h,y)=>{const v=l.length>0&&y<l.length-1;return e.jsxRuntimeExports.jsx(Ge,{item:h,index:y,canDelete:v,onChange:f,onRemove:()=>g(y)})}))]})]})})]})};function Qe(){const[s,n]=o.useStylingState(),{flexChild:r,gridChild:l}=o.useSelectedBlocksDisplayChild(),[,i]=be.useAtom(o.advanceStylingOpenAtom),{t:c}=A.useTranslation(),[a]=o.useSelectedStylingBlocks();return t.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(d.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:c("no_styling_block_selected")}),e.jsxRuntimeExports.jsxs("p",{className:"text-xs ",children:["Hint: Styling allowed blocks are highlighted with"," ",e.jsxRuntimeExports.jsx("span",{className:"border border-orange-500 p-px",children:"orange"})," border"]})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>i(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-x-4 space-y-3 border-b h-12 border-border px-4 py-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:s,onValueChange:x=>n(x),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 flex-1 max-h-full overflow-y-hidden overflow-x-hidden",children:e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"w-full",children:[r&&e.jsxRuntimeExports.jsx(W,{section:_e}),l?e.jsxRuntimeExports.jsx(W,{section:He}):null,Ve.map(x=>e.jsxRuntimeExports.jsx(W,{section:x},x.heading)),e.jsxRuntimeExports.jsx(Je,{section:{heading:"Attributes"}})]})})]})}const et={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},tt=()=>{const s=o.useSelectedBlock(),{t:n}=A.useTranslation(),[r,l]=m.useState(""),[i,c]=m.useState({onDrag:u=>u,onDragEnd:u=>u,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),a=z.useThrottledCallback(u=>{const g=!t.get(i,"negative",!1),f=t.get(i,"cssProperty","");let p=parseFloat(i.dragStartValue);p=t.isNaN(p)?0:p;let b=et[i.dragUnit];(t.startsWith(f,"scale")||f==="opacity")&&(b=10);let y=(i.dragStartY-u.pageY)/b+p;g&&y<0&&(y=0),f==="opacity"&&y>1&&(y=1),i.onDrag(`${y}`),l(`${y}`)},[i],50),x=m.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),c({onDrag:u=>u,onDragEnd:u=>u,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,c]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(d.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:n("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(q.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ne.Provider,{value:{setDragData:c},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:a,onMouseUp:()=>x(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "}):null,e.jsxRuntimeExports.jsxs(o.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(o.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"settings",children:n("settings")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"styling",children:n("styling")})]}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"settings",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 pb-5 flex-1 max-h-full overflow-y-hidden overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Te,{})})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"flex-1 h-full overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Qe,{})})]})]})})};exports.default=tt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var S=Object.create;var q=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var z=(r,o,i,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let x of T(o))!A.call(r,x)&&x!==i&&q(r,x,{get:()=>o[x],enumerable:!(l=P(o,x))||l.enumerable});return r};var _=(r,o,i)=>(i=r!=null?S(D(r)):{},z(o||!r||!r.__esModule?q(i,"default",{value:r,enumerable:!0}):i,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("@radix-ui/react-icons"),n=require("react"),k=require("jotai"),u=require("lodash-es"),s=require("./index-IIJ_o44s.cjs"),E=require("lucide-react"),B=require("@chaibuilder/runtime"),y=require("react-i18next"),K=require("./index-mUPP605-.cjs"),I=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");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-scroll-area");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-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-5UoswV2Q.cjs");require("himalaya");require("lodash");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const V=n.lazy(()=>import("react-json-view")),L=({provider:r,onClose:o})=>{const{t:i}=y.useTranslation(),[l,x]=n.useState(null);return n.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(c=>x(c))},[r]),r?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:d=>d?"":o(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[i("data_provider"),": ",r.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(K.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(V,{style:{maxHeight:"80vh",overflowY:"auto"},name:r.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:l})})]})}):null};function M({children:r,name:o,onRemove:i}){const{t:l}=y.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:r}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{children:l("remove_provider_confirmation",{name:o})}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:i,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const F=()=>{const{t:r}=y.useTranslation(),o=n.useMemo(()=>B.getChaiDataProviders(),[]),[i,l]=s.usePageDataProviders(),[,x]=k.useAtom(s.pageSyncStateAtom),[d,c]=n.useState(u.filter(o,t=>u.map(i,"providerKey").includes(t.providerKey))),[g,v]=n.useState(""),[m,f]=n.useState(null),R=u.filter(o.map(t=>u.map(d,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!u.isNull(t)),a=t=>{const p=u.find(o,{providerKey:t});c(j=>[...j,p]),l(j=>[...j,{providerKey:p.providerKey,args:{}}]),v(""),x("UNSAVED")},h=t=>{c(p=>u.filter(p,j=>j.providerKey!==t.providerKey)),l(p=>u.filter(p,j=>j.providerKey!==t.providerKey)),x("UNSAVED")},C=t=>f(t);return u.isEmpty(o)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 mb-1.5 text-xs p-4",children:[r("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:r("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:r("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:g,onValueChange:t=>a(t),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:r("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:r("choose")}),R.map(t=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${d.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium",children:[r("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:d.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm w-full","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex justify-between items-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-gray-400 pt-1",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"items-center p-2 py-2 flex justify-between",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>C(t),className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),r("view_data")]}),e.jsxRuntimeExports.jsx(M,{onRemove:()=>h(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"w-4 h-4 mr-2",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),r("remove")]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(L,{onClose:()=>f(null),provider:m})]})]})},H=n.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-wuKI1ieB.cjs"))),b=n.lazy(()=>Promise.resolve().then(()=>require("./Layers-EGhZWmvD.cjs"))),O=n.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-arKT1zCy.cjs"))),U=n.lazy(()=>Promise.resolve().then(()=>require("./index-IIJ_o44s.cjs")).then(r=>r.ImagesPanel));let N=null;const $=()=>{const r=s.useBuilderProp("sideBarComponents.top",[]),o=s.useBuilderProp("sideBarComponents.bottom",[]),[i,l]=k.useAtom(s.activePanelAtom),[x,d]=n.useState(i),[c,g]=n.useState(null),v={"add-blocks":H,layers:b,"branding-options":O,images:U};u.each(r,({name:a,panel:h})=>{v[a]=h});const m=a=>{clearTimeout(N),i!=="layers"&&a==="layers"?N=setTimeout(()=>l("layers"),500):d(a),l(a)},f=s.useBuilderProp("dataBindingSupport",!1);function R(){const a=setTimeout(()=>{c&&(m("layers"),clearTimeout(c))},500);g(a)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex ",children:[i!=="layers"?e.jsxRuntimeExports.jsx("div",{onMouseEnter:R,onClick:()=>m("layers"),className:"fixed inset-0 bg-black/20 z-[50]"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{m("add-blocks")},size:"sm",variant:i==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m("layers"),size:"sm",variant:i==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m("branding-options"),size:"sm",variant:i==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),n.Children.toArray(r.map(({name:a,icon:h})=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m(a),size:"sm",className:"w-10",variant:i===a?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:n.Children.toArray(o.map(a=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(a,{})})))})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${i!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:I.cn("relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",i==="layers"?"":"z-[100]"),onMouseEnter:()=>{c&&clearTimeout(c)},children:n.createElement(u.get(v,i,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:f?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:n.createElement(b)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(F,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center bg-gray-200 rounded-md py-1",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"h-4 mr-2 ml-2"})," Layers"]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:n.createElement(b)})]})})})]})};exports.default=$;
|