@chaibuilder/sdk 1.2.25 → 1.2.27
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-S-4jzdWv.cjs +1 -0
- package/dist/AddBlocks-ksZjjn0k.js +205 -0
- package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
- package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-T_kbQFQv.js} +53 -40
- package/dist/CanvasArea-SDzbubar.cjs +55 -0
- package/dist/{CanvasArea-dZjng782.js → CanvasArea-rhOeubmu.js} +323 -340
- package/dist/{Class-ahc3NIbq.js → Class-3k8xjeiM.js} +29 -26
- package/dist/Class-MmCxz2Ay.cjs +1 -0
- package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-0eeU1V_c.js} +53 -40
- package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/{ListTree-N3jeD790.js → ListTree-Muu4rAtp.js} +96 -87
- package/dist/ListTree-SWsqdfcG.cjs +1 -0
- package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
- package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-WQdaNvb8.js} +8 -10
- package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
- package/dist/{PagesPanel-u1IB-nRr.js → PagesPanel-rYN28QpN.js} +44 -29
- package/dist/ProjectPanel-ivFOhdcz.js +84 -0
- package/dist/ProjectPanel-pBePMOta.cjs +1 -0
- package/dist/Settings-JRyJayf5.cjs +1 -0
- package/dist/{Settings-jCcd-VE6.js → Settings-XWmKzRl9.js} +400 -407
- package/dist/SidePanels-BtUeo6M9.cjs +1 -0
- package/dist/{SidePanels-pHMYprpW.js → SidePanels-ODktnGbC.js} +117 -108
- package/dist/Topbar-QMeD3hvq.cjs +1 -0
- package/dist/Topbar-Yunooh00.js +131 -0
- package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
- package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-QMl0bxix.js} +59 -47
- package/dist/UploadImages-OgSN1HVt.cjs +1 -0
- package/dist/{UploadImages-zdEJRLD8.js → UploadImages-Si-A26bc.js} +58 -36
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/add-page-modal-9pTKItY-.cjs +1 -0
- package/dist/add-page-modal-U7AUUrI1.js +103 -0
- package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
- package/dist/confirm-alert-kV5-c70T.js +59 -0
- package/dist/controls-KK2oLIa8.cjs +1 -0
- package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +74 -150
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-gunU_Fe5.js} +8 -6
- package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
- package/dist/delete-page-modal-UCBpdjLe.js +82 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +292 -3
- package/dist/email.cjs +1 -1
- package/dist/email.js +36 -18
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/form-Ap63cNec.cjs +1 -0
- package/dist/{form-0_RLz2TB.js → form-zmlTjM9j.js} +12 -12
- package/dist/html-to-json-C_Eobs_d.cjs +1 -0
- package/dist/{html-to-json-2xtb7520.js → html-to-json-p__Fgqdg.js} +65 -40
- package/dist/index-CFUoB97-.js +3079 -0
- package/dist/index-F4AQQ6qq.cjs +1 -0
- package/dist/index-Qk028f-N.cjs +1 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/index-f0AbmoYY.js +2201 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/index-l19JVVXI.cjs +206 -0
- package/dist/index-lOJfSheQ.js +39503 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
- package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +59 -56
- package/dist/page-viewer-YFrIG3L7.cjs +1 -0
- package/dist/{page-viewer-NnOwmAmu.js → page-viewer-jOwy--9A.js} +56 -43
- package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-3N8HZ2fe.js} +42 -35
- package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
- package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-bSiNgO_1.js} +39 -23
- package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +16 -16
- package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail--AZlZ-pC.js} +73 -66
- package/dist/single-page-detail-9abF2g2R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +39 -24
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +158 -364
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1052 -3
- package/package.json +1 -1
- package/dist/AddBlocks-Ol3iIVKa.js +0 -207
- package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
- package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
- package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
- package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
- package/dist/Class-eieto7e-.cjs +0 -1
- package/dist/Controls-3Cc1XYXg.js +0 -105
- package/dist/Controls-ky25Ebo3.cjs +0 -1
- package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
- package/dist/Functions-Hvon6AMZ.cjs +0 -1
- package/dist/Functions-NzT2Six_.js +0 -15
- package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
- package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
- package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
- package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
- package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
- package/dist/ProjectPanel-EydGZmMW.js +0 -71
- package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
- package/dist/STRINGS-b432aBJJ.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-8ilCSH8b.cjs +0 -1
- package/dist/SidePanels-T36C6Lhc.cjs +0 -1
- package/dist/Topbar-CvWQuspR.cjs +0 -1
- package/dist/Topbar-pbIDUE_B.js +0 -122
- package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
- package/dist/UploadImages-GkkJVAgG.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
- package/dist/add-page-modal-JCDXZIPW.js +0 -95
- package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
- package/dist/alert-dialog-rypfO5ly.js +0 -64
- package/dist/badge-E-S7CqUt.cjs +0 -1
- package/dist/badge-tEwO7C51.js +0 -23
- package/dist/block-helpers-OKHmRRol.cjs +0 -1
- package/dist/block-helpers-oSFpSsGz.js +0 -23
- package/dist/command-BxR6jaCI.cjs +0 -1
- package/dist/command-Pn3HKDuV.js +0 -97
- package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
- package/dist/confirm-alert-wR5_VJ1l.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-L7DPvB0m.cjs +0 -1
- package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
- package/dist/delete-page-modal-7KmP1elv.js +0 -67
- package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
- package/dist/dropdown-menu-El86_9Uo.js +0 -124
- package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
- package/dist/form-W58AVUdf.cjs +0 -1
- package/dist/hover-card-KUwpDkW8.cjs +0 -1
- package/dist/hover-card-q138xxXR.js +0 -45
- package/dist/html-to-json-uSnxl72F.cjs +0 -1
- package/dist/iconBase-gbUAAO2L.cjs +0 -1
- package/dist/iconBase-h4DuR_XT.js +0 -63
- package/dist/index-9MmykVSc.cjs +0 -1
- package/dist/index-hElOGcFr.js +0 -2200
- package/dist/index-lDTsQp7h.js +0 -188
- package/dist/index-rq5Y9ZDy.cjs +0 -1
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-WbcKdQ9k.cjs +0 -1
- package/dist/link-xuhP-4dN.js +0 -196
- package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
- package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-beY0MT1b.cjs +0 -1
- package/dist/skeleton-STeL9VrJ.cjs +0 -1
- package/dist/skeleton-lu8e7q2y.js +0 -239
- package/dist/tabs-_4WbA1cc.cjs +0 -1
- package/dist/tabs-yQ3oGziM.js +0 -106
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
- package/dist/useAddBlock-FEKFJNwQ.js +0 -69
- package/dist/useChaiExternalData-fkFgoS80.js +0 -6
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
- package/dist/useDarkMode-7i57segK.cjs +0 -1
- package/dist/useDarkMode-8VHJlYyE.js +0 -23
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
- package/dist/useStylingState-Iuj84yvc.js +0 -186
- package/dist/useStylingState-OIvJMV6p.cjs +0 -1
- package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
- package/dist/useUiLibraries-psyWFbNc.js +0 -12
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),t=require("lodash-es"),y=require("jotai"),v=require("react-i18next"),s=require("./index-F4AQQ6qq.cjs"),B=require("@radix-ui/react-icons"),b=require("@chaibuilder/runtime"),q=require("flagged"),R=require("./MODIFIERS-9EwxLM8V.cjs"),N=require("lucide-react"),C=require("./html-to-json-C_Eobs_d.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@react-hookz/web");require("./Class-MmCxz2Ay.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("himalaya");const T=({block:r})=>{const{type:i,icon:u,label:c}=r,{addCoreBlock:m,addPredefinedBlock:d}=s.useAddBlock(),[x,o]=s.useSelectedBlockIds(),[,j]=s.useHighlightBlockId(),[,p]=y.useAtom(s.activePanelAtom),l=()=>{if(t.has(r,"blocks")){const h=t.isFunction(r.blocks)?r.blocks():r.blocks;d(b.syncBlocksWithDefaults(h),t.first(x))}else m(r,t.first(x));p(R.OUTLINE_KEY)},a=q.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:l,type:"button",onDragStart:h=>{h.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{o([]),j(null),p(R.OUTLINE_KEY)},200)},draggable:a?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(a?"cursor-grab":"cursor-pointer"),children:[n.createElement(u||B.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:c||i})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:c||i})})]})})},A=({block:r,closePopover:i})=>{const[u,c]=n.useState(!1),m=s.useBuilderProp("getExternalPredefinedBlock",t.noop()),{addCoreBlock:d,addPredefinedBlock:x}=s.useAddBlock(),[o]=s.useSelectedBlockIds(),j=n.useCallback(async p=>{if(p.stopPropagation(),t.has(r,"component")){d(r,t.first(o)),i();return}c(!0);const l=await m(r);t.isEmpty(l)||x(b.syncBlocksWithDefaults(l),t.first(o)),i()},[r]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{onClick:u?()=>{}:j,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:[u&&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})})]})})},w=()=>{const{data:r}=s.useUILibraryBlocks(),i=b.useChaiBlocks(),u=t.filter(t.values(i),{category:"custom"}),c=t.groupBy(u,"group"),m=t.groupBy(r,"group"),d=n.useMemo(()=>t.mergeWith(c,m,(l,a)=>{if(t.isArray(l)&&t.isArray(a))return[...l,...a]}),[c,m]),[x,o]=n.useState(t.first(t.keys(d))||""),[,j]=y.useAtom(s.activePanelAtom),p=t.get(d,x,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full flex-col overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex w-full items-center p-3",children:e.jsxRuntimeExports.jsxs(s.Select,{value:x,onValueChange:l=>o(l),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"}),n.Children.toArray(t.map(d,(l,a)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:a,children:a},a)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:n.Children.toArray(p.map(l=>e.jsxRuntimeExports.jsx(A,{block:l,closePopover:()=>j(R.OUTLINE_KEY)})))})]})},S=()=>{const{t:r}=v.useTranslation(),[i,u]=n.useState(""),{addPredefinedBlock:c}=s.useAddBlock(),[m]=s.useSelectedBlockIds(),[,d]=y.useAtom(s.activePanelAtom),x=()=>{const o=C.getBlocksFromHTML(i);c([...o],t.first(m)||null),u(""),d(R.OUTLINE_KEY)};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:o=>o&&o.focus(),onChange:o=>u(o.target.value),rows:12,value:i,placeholder:r("enter_code_snippet"),className:"resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:i.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 border-none p-1 text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},_=()=>{const{t:r}=v.useTranslation(),[i,u]=n.useState("core"),[c,m]=n.useState("basic"),d=b.useChaiBlocks(),[,x]=y.useAtom(s.showPredefinedBlockCategoryAtom),o=s.useBuilderProp("importHTMLSupport",!0),j=s.useBuilderProp("filterChaiBlock",()=>!0),{data:p,isLoading:l}=s.useUILibraryBlocks(),a=t.filter(d,j),h=t.groupBy(a,"category"),g=t.uniq(t.map(h.core,"group"));n.useEffect(()=>{!t.includes(g,c)&&!t.isEmpty(g)&&!t.isEmpty(c)&&m(t.first(g))},[g,c]);const E=!l&&!t.isEmpty(p)||t.find(t.values(a),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-72 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(i==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:f=>{x(""),u(f)},value:i,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(E&&o?"grid-cols-3":E&&!o||!E&&o?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("Blocks")}),E?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:r("ui_library")}):null,o?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),i==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:n.Children.toArray(t.map(g,f=>t.reject(t.filter(t.values(h.core),{group:f}),{hidden:!0}).length?e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:f,collapsible:!0,className:"w-full",children:e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:f,children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"rounded-md bg-gray-100 px-4 py-2 capitalize",children:f}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"p-3",children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:n.Children.toArray(t.reject(t.filter(t.values(h.core),{group:f}),{hidden:!0}).map(k=>e.jsxRuntimeExports.jsx(T,{block:k})))})})]})}):null))})}),i==="ui-blocks"&&e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(w,{})}),i==="html"&&o?e.jsxRuntimeExports.jsx(S,{}):null]})};exports.default=_;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import y, { createElement as D, useState as g, useCallback as O, useMemo as U, useEffect as V, Suspense as R } from "react";
|
|
3
|
+
import { has as F, isFunction as W, first as h, omit as Y, noop as J, isEmpty as b, filter as v, values as k, groupBy as w, mergeWith as K, isArray as L, keys as Q, get as X, map as A, uniq as Z, includes as $, find as ee, reject as I } from "lodash-es";
|
|
4
|
+
import { useAtom as N } from "jotai";
|
|
5
|
+
import { useTranslation as H } from "react-i18next";
|
|
6
|
+
import { L as _, r as S, Y as se, at as P, ap as te, aq as re, ar as oe, h as T, a3 as G, aj as le, ak as ae, al as ce, am as ie, an as E, bj as ne, bk as de, bl as me, bm as pe, aB as ue, bn as xe, bo as he, B as fe, bp as ge, bq as je, br as be, au as ve, av as ke, aw as C, bf as ye, b9 as Be, ba as Ne, bb as Ce, bc as we, S as Ae } from "./index-CFUoB97-.js";
|
|
7
|
+
import { BoxIcon as Te } from "@radix-ui/react-icons";
|
|
8
|
+
import { syncBlocksWithDefaults as M, useChaiBlocks as q } from "@chaibuilder/runtime";
|
|
9
|
+
import { useFeature as _e } from "flagged";
|
|
10
|
+
import { O as B } from "./MODIFIERS-WQdaNvb8.js";
|
|
11
|
+
import { Loader as Se } from "lucide-react";
|
|
12
|
+
import { g as Pe } from "./html-to-json-p__Fgqdg.js";
|
|
13
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
|
+
import "./Functions-7jnEwJyw.js";
|
|
15
|
+
import "clsx";
|
|
16
|
+
import "tailwind-merge";
|
|
17
|
+
import "@react-hookz/web";
|
|
18
|
+
import "./Class-3k8xjeiM.js";
|
|
19
|
+
import "@radix-ui/react-toggle";
|
|
20
|
+
import "class-variance-authority";
|
|
21
|
+
import "@radix-ui/react-switch";
|
|
22
|
+
import "@radix-ui/react-slot";
|
|
23
|
+
import "@radix-ui/react-accordion";
|
|
24
|
+
import "@radix-ui/react-alert-dialog";
|
|
25
|
+
import "@radix-ui/react-dialog";
|
|
26
|
+
import "@radix-ui/react-label";
|
|
27
|
+
import "@radix-ui/react-scroll-area";
|
|
28
|
+
import "@radix-ui/react-tabs";
|
|
29
|
+
import "@radix-ui/react-tooltip";
|
|
30
|
+
import "@radix-ui/react-popover";
|
|
31
|
+
import "@radix-ui/react-menubar";
|
|
32
|
+
import "@radix-ui/react-hover-card";
|
|
33
|
+
import "@radix-ui/react-select";
|
|
34
|
+
import "@radix-ui/react-dropdown-menu";
|
|
35
|
+
import "@radix-ui/react-separator";
|
|
36
|
+
import "@radix-ui/react-toast";
|
|
37
|
+
import "cmdk";
|
|
38
|
+
import "@radix-ui/react-context-menu";
|
|
39
|
+
import "react-icons-picker";
|
|
40
|
+
import "react-dom";
|
|
41
|
+
import "react-quill";
|
|
42
|
+
import "himalaya";
|
|
43
|
+
const Le = ({ block: s }) => {
|
|
44
|
+
const { type: r, icon: c, label: l } = s, { addCoreBlock: d, addPredefinedBlock: i } = _(), [n, t] = S(), [, p] = se(), [, m] = N(P), o = () => {
|
|
45
|
+
if (F(s, "blocks")) {
|
|
46
|
+
const u = W(s.blocks) ? s.blocks() : s.blocks;
|
|
47
|
+
i(M(u), h(n));
|
|
48
|
+
} else
|
|
49
|
+
d(s, h(n));
|
|
50
|
+
m(B);
|
|
51
|
+
}, a = _e("dnd");
|
|
52
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(te, { children: [
|
|
53
|
+
/* @__PURE__ */ e.jsx(re, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
onClick: o,
|
|
57
|
+
type: "button",
|
|
58
|
+
onDragStart: (u) => {
|
|
59
|
+
u.dataTransfer.setData("text/plain", JSON.stringify(Y(s, ["component", "icon"]))), setTimeout(() => {
|
|
60
|
+
t([]), p(null), m(B);
|
|
61
|
+
}, 200);
|
|
62
|
+
},
|
|
63
|
+
draggable: a ? "true" : "false",
|
|
64
|
+
className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (a ? "cursor-grab" : "cursor-pointer"),
|
|
65
|
+
children: [
|
|
66
|
+
D(c || Te, { className: "w-4 h-4 mx-auto" }),
|
|
67
|
+
/* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: l || r })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
) }),
|
|
71
|
+
/* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsx("p", { children: l || r }) })
|
|
72
|
+
] }) });
|
|
73
|
+
}, Ie = ({ block: s, closePopover: r }) => {
|
|
74
|
+
const [c, l] = g(!1), d = T("getExternalPredefinedBlock", J()), { addCoreBlock: i, addPredefinedBlock: n } = _(), [t] = S(), p = O(
|
|
75
|
+
async (m) => {
|
|
76
|
+
if (m.stopPropagation(), F(s, "component")) {
|
|
77
|
+
i(s, h(t)), r();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
l(!0);
|
|
81
|
+
const o = await d(s);
|
|
82
|
+
b(o) || n(M(o), h(t)), r();
|
|
83
|
+
},
|
|
84
|
+
[s]
|
|
85
|
+
);
|
|
86
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
onClick: c ? () => {
|
|
90
|
+
} : p,
|
|
91
|
+
className: "relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",
|
|
92
|
+
children: [
|
|
93
|
+
c && /* @__PURE__ */ e.jsxs("div", { className: "absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70", children: [
|
|
94
|
+
/* @__PURE__ */ e.jsx(Se, { className: "animate-spin", size: 15, color: "white" }),
|
|
95
|
+
" ",
|
|
96
|
+
/* @__PURE__ */ e.jsx("span", { className: "pl-2 text-sm text-white", children: "Adding..." })
|
|
97
|
+
] }),
|
|
98
|
+
s.preview ? /* @__PURE__ */ e.jsx(
|
|
99
|
+
"img",
|
|
100
|
+
{
|
|
101
|
+
src: s.preview,
|
|
102
|
+
className: "min-h-[50px] w-full rounded-md border border-gray-300",
|
|
103
|
+
alt: s.label
|
|
104
|
+
}
|
|
105
|
+
) : /* @__PURE__ */ e.jsx("div", { className: "flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200", children: /* @__PURE__ */ e.jsx("p", { className: "max-w-xs text-center text-sm text-gray-700", children: s.label }) })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
) });
|
|
109
|
+
}, Ee = () => {
|
|
110
|
+
const { data: s } = G(), r = q(), c = v(k(r), { category: "custom" }), l = w(c, "group"), d = w(s, "group"), i = U(() => K(l, d, (o, a) => {
|
|
111
|
+
if (L(o) && L(a))
|
|
112
|
+
return [...o, ...a];
|
|
113
|
+
}), [l, d]), [n, t] = g(h(Q(i)) || ""), [, p] = N(P), m = X(i, n, []);
|
|
114
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden py-2", children: [
|
|
115
|
+
/* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex w-full items-center p-3", children: /* @__PURE__ */ e.jsxs(le, { value: n, onValueChange: (o) => t(o), children: [
|
|
116
|
+
/* @__PURE__ */ e.jsx(ae, { className: "w-full", children: /* @__PURE__ */ e.jsx(ce, { placeholder: "Select a provider" }) }),
|
|
117
|
+
/* @__PURE__ */ e.jsxs(ie, { children: [
|
|
118
|
+
/* @__PURE__ */ e.jsx(E, { value: "", children: "Choose" }),
|
|
119
|
+
y.Children.toArray(
|
|
120
|
+
A(i, (o, a) => /* @__PURE__ */ e.jsx(E, { value: a, children: a }, a))
|
|
121
|
+
)
|
|
122
|
+
] })
|
|
123
|
+
] }) }),
|
|
124
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-full w-full space-y-2 overflow-y-auto px-2", children: y.Children.toArray(
|
|
125
|
+
m.map((o) => /* @__PURE__ */ e.jsx(Ie, { block: o, closePopover: () => p(B) }))
|
|
126
|
+
) })
|
|
127
|
+
] });
|
|
128
|
+
}, Fe = () => {
|
|
129
|
+
const { t: s } = H(), [r, c] = g(""), { addPredefinedBlock: l } = _(), [d] = S(), [, i] = N(P), n = () => {
|
|
130
|
+
const t = Pe(r);
|
|
131
|
+
l([...t], h(d) || null), c(""), i(B);
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ e.jsxs(ne, { className: "border-border/0 p-0 shadow-none", children: [
|
|
134
|
+
/* @__PURE__ */ e.jsx(de, { className: "p-3", children: /* @__PURE__ */ e.jsx(me, { children: s("html_snippet_description") }) }),
|
|
135
|
+
/* @__PURE__ */ e.jsx(pe, { className: "space-y-2 px-3 py-0", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
136
|
+
/* @__PURE__ */ e.jsx(ue, { htmlFor: "current", className: "text-sm", children: s("tailwind_html_snippet") }),
|
|
137
|
+
/* @__PURE__ */ e.jsx(
|
|
138
|
+
xe,
|
|
139
|
+
{
|
|
140
|
+
autoFocus: !0,
|
|
141
|
+
tabIndex: 1,
|
|
142
|
+
ref: (t) => t && t.focus(),
|
|
143
|
+
onChange: (t) => c(t.target.value),
|
|
144
|
+
rows: 12,
|
|
145
|
+
value: r,
|
|
146
|
+
placeholder: s("enter_code_snippet"),
|
|
147
|
+
className: "resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] }) }),
|
|
151
|
+
/* @__PURE__ */ e.jsxs(he, { className: "flex flex-col justify-end p-3", children: [
|
|
152
|
+
/* @__PURE__ */ e.jsx(fe, { disabled: r.trim() === "", onClick: () => n(), size: "sm", className: "w-full", children: s("import_html") }),
|
|
153
|
+
/* @__PURE__ */ e.jsx(ge, { variant: "default", className: "mt-2 border-none p-1 text-gray-400", children: /* @__PURE__ */ e.jsx(je, { className: "text-xs font-normal leading-4", children: s("note_imported_html") }) })
|
|
154
|
+
] })
|
|
155
|
+
] });
|
|
156
|
+
}, Ns = () => {
|
|
157
|
+
const { t: s } = H(), [r, c] = g("core"), [l, d] = g("basic"), i = q(), [, n] = N(be), t = T("importHTMLSupport", !0), p = T("filterChaiBlock", () => !0), { data: m, isLoading: o } = G(), a = v(i, p), u = w(a, "category"), f = Z(A(u.core, "group"));
|
|
158
|
+
V(() => {
|
|
159
|
+
!$(f, l) && !b(f) && !b(l) && d(h(f));
|
|
160
|
+
}, [f, l]);
|
|
161
|
+
const j = !o && !b(m) || ee(k(a), { category: "custom" }) !== void 0;
|
|
162
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full w-72 flex-col overflow-hidden", children: [
|
|
163
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1", children: [
|
|
164
|
+
/* @__PURE__ */ e.jsx("h1", { className: "flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col", children: s("add_block") }),
|
|
165
|
+
/* @__PURE__ */ e.jsx("span", { className: "p-0 text-xs font-light leading-3 opacity-80 xl:pl-1", children: s(r === "html" ? "enter_paste_tailwind_html" : "click_to_add_block") })
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ e.jsx(
|
|
168
|
+
ve,
|
|
169
|
+
{
|
|
170
|
+
onValueChange: (x) => {
|
|
171
|
+
n(""), c(x);
|
|
172
|
+
},
|
|
173
|
+
value: r,
|
|
174
|
+
className: "h-max",
|
|
175
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
176
|
+
ke,
|
|
177
|
+
{
|
|
178
|
+
className: "grid w-full " + (j && t ? "grid-cols-3" : j && !t || !j && t ? "grid-cols-2" : "grid-cols-1"),
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ e.jsx(C, { value: "core", children: s("Blocks") }),
|
|
181
|
+
j ? /* @__PURE__ */ e.jsx(C, { value: "ui-blocks", children: s("ui_library") }) : null,
|
|
182
|
+
t ? /* @__PURE__ */ e.jsx(C, { value: "html", children: s("import") }) : null
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
r === "core" && /* @__PURE__ */ e.jsx(ye, { className: "-mx-1.5 h-full", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 w-full", children: y.Children.toArray(
|
|
189
|
+
A(
|
|
190
|
+
f,
|
|
191
|
+
(x) => I(v(k(u.core), { group: x }), { hidden: !0 }).length ? /* @__PURE__ */ e.jsx(Be, { type: "single", value: x, collapsible: !0, className: "w-full", children: /* @__PURE__ */ e.jsxs(Ne, { value: x, children: [
|
|
192
|
+
/* @__PURE__ */ e.jsx(Ce, { className: "rounded-md bg-gray-100 px-4 py-2 capitalize", children: x }),
|
|
193
|
+
/* @__PURE__ */ e.jsx(we, { className: "p-3", children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3 gap-2", children: y.Children.toArray(
|
|
194
|
+
I(v(k(u.core), { group: x }), { hidden: !0 }).map((z) => /* @__PURE__ */ e.jsx(Le, { block: z }))
|
|
195
|
+
) }) })
|
|
196
|
+
] }) }) : null
|
|
197
|
+
)
|
|
198
|
+
) }) }),
|
|
199
|
+
r === "ui-blocks" && /* @__PURE__ */ e.jsx(R, { fallback: /* @__PURE__ */ e.jsx(Ae, { className: "h-32 w-full" }), children: /* @__PURE__ */ e.jsx(Ee, {}) }),
|
|
200
|
+
r === "html" && t ? /* @__PURE__ */ e.jsx(Fe, {}) : null
|
|
201
|
+
] });
|
|
202
|
+
};
|
|
203
|
+
export {
|
|
204
|
+
Ns as default
|
|
205
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),B=require("react"),R=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./index-F4AQQ6qq.cjs"),r=require("./controls-KK2oLIa8.cjs"),f=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("react-i18next");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-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");function N(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const x=N(B),k=({value:t,onChange:e,id:i,onBlur:l})=>{const n=f.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},m=[{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=p.useBuilderProp("onSaveBrandingOptions",f.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=x.useRef(e);x.useEffect(()=>()=>{f.isEqual(e,n.current)||t(n.current)},[]);const v=({formData:o},c)=>{c&&(i(o),n.current=o)},{bodyFont:u,headingFont:q,primaryColor:b,bodyTextDarkColor:h,bodyTextLightColor:y,bodyBgDarkColor:S,secondaryColor:C,bodyBgLightColor:O,roundedCorners:j}=e;let s={headingFont:r.s({title:"Heading font",default:q,options:m}),bodyFont:r.s({title:"Body font",default:u,options:m}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(j||5,10)}),primaryColor:r.f({title:"Primary",default:b}),secondaryColor:r.f({title:"Secondary",default:C})};l||(s={...s,bodyBgLightColor:r.f({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.f({title:"Body Text (Light Mode)",default:h}),bodyBgDarkColor:r.f({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.f({title:"Body Text (Dark mode)",default:y})});const d={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const c=s[o];return d.properties||(d.properties={}),d.properties[o]=c.schema,g[o]=c.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:k},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:d,formData:e,validator:R,onChange:v})})]})};exports.default=P;
|
|
@@ -1,40 +1,53 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-
|
|
1
|
+
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import N from "@rjsf/validator-ajv8";
|
|
4
4
|
import j from "@rjsf/core";
|
|
5
|
-
import { h as k,
|
|
6
|
-
import "
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import "./MODIFIERS-CNqNUapY.js";
|
|
5
|
+
import { h as k, F as w, by as D } from "./index-CFUoB97-.js";
|
|
6
|
+
import { s as f, c as P, f as a } from "./controls-OfJWSEqC.js";
|
|
7
|
+
import { debounce as R, noop as F, isEqual as L } from "lodash-es";
|
|
8
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
|
+
import "./Functions-7jnEwJyw.js";
|
|
11
10
|
import "clsx";
|
|
12
|
-
import "@radix-ui/react-scroll-area";
|
|
13
|
-
import "react-dom";
|
|
14
|
-
import "@floating-ui/react-dom";
|
|
15
|
-
import "jotai";
|
|
16
|
-
import "i18next";
|
|
17
|
-
import "flagged";
|
|
18
|
-
import "./Functions-NzT2Six_.js";
|
|
19
11
|
import "tailwind-merge";
|
|
20
|
-
import "@radix-ui/react-icons";
|
|
21
|
-
import "react-hotkeys-hook";
|
|
22
|
-
import "@react-hookz/web";
|
|
23
12
|
import "@chaibuilder/runtime";
|
|
24
|
-
import "
|
|
13
|
+
import "jotai";
|
|
14
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
15
|
+
import "@react-hookz/web";
|
|
16
|
+
import "./Class-3k8xjeiM.js";
|
|
17
|
+
import "react-i18next";
|
|
18
|
+
import "@radix-ui/react-toggle";
|
|
25
19
|
import "class-variance-authority";
|
|
26
|
-
import "
|
|
20
|
+
import "@radix-ui/react-switch";
|
|
21
|
+
import "@radix-ui/react-slot";
|
|
22
|
+
import "@radix-ui/react-accordion";
|
|
23
|
+
import "@radix-ui/react-icons";
|
|
24
|
+
import "@radix-ui/react-alert-dialog";
|
|
25
|
+
import "@radix-ui/react-dialog";
|
|
26
|
+
import "@radix-ui/react-label";
|
|
27
|
+
import "@radix-ui/react-scroll-area";
|
|
28
|
+
import "@radix-ui/react-tabs";
|
|
27
29
|
import "@radix-ui/react-tooltip";
|
|
30
|
+
import "@radix-ui/react-popover";
|
|
31
|
+
import "@radix-ui/react-menubar";
|
|
32
|
+
import "@radix-ui/react-hover-card";
|
|
33
|
+
import "@radix-ui/react-select";
|
|
34
|
+
import "@radix-ui/react-dropdown-menu";
|
|
35
|
+
import "@radix-ui/react-separator";
|
|
28
36
|
import "@radix-ui/react-toast";
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
import "cmdk";
|
|
38
|
+
import "@radix-ui/react-context-menu";
|
|
39
|
+
import "react-icons-picker";
|
|
40
|
+
import "react-dom";
|
|
41
|
+
import "react-quill";
|
|
42
|
+
const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
|
|
43
|
+
const i = R(e, 200), m = (l) => i(l.target.value);
|
|
31
44
|
return /* @__PURE__ */ t.jsx("div", { className: "mt-1.5 flex items-center gap-x-3", children: /* @__PURE__ */ t.jsx("div", { className: "flex w-3/5 flex-col", children: /* @__PURE__ */ t.jsx(
|
|
32
45
|
"input",
|
|
33
46
|
{
|
|
34
47
|
type: "color",
|
|
35
48
|
className: "text-xs p-0",
|
|
36
49
|
value: u,
|
|
37
|
-
onBlur: ({ target: { value: l } }) => p
|
|
50
|
+
onBlur: ({ target: { value: l } }) => d(p, l),
|
|
38
51
|
onChange: m
|
|
39
52
|
}
|
|
40
53
|
) }) });
|
|
@@ -88,13 +101,13 @@ const F = ({ value: u, onChange: e, id: d, onBlur: p }) => {
|
|
|
88
101
|
{ title: "Lustria", value: "Lustria" },
|
|
89
102
|
{ title: "Ovo", value: "Ovo" },
|
|
90
103
|
{ title: "Suranna", value: "Suranna" }
|
|
91
|
-
],
|
|
92
|
-
const u =
|
|
104
|
+
], Ct = () => {
|
|
105
|
+
const u = k("onSaveBrandingOptions", F), [e, p] = w(), [d] = D(), i = c.useRef(e);
|
|
93
106
|
c.useEffect(() => () => {
|
|
94
|
-
|
|
107
|
+
L(e, i.current) || u(i.current);
|
|
95
108
|
}, []);
|
|
96
|
-
const m = ({ formData:
|
|
97
|
-
s && (
|
|
109
|
+
const m = ({ formData: o }, s) => {
|
|
110
|
+
s && (p(o), i.current = o);
|
|
98
111
|
}, {
|
|
99
112
|
bodyFont: l,
|
|
100
113
|
headingFont: h,
|
|
@@ -117,28 +130,28 @@ const F = ({ value: u, onChange: e, id: d, onBlur: p }) => {
|
|
|
117
130
|
default: l,
|
|
118
131
|
options: g
|
|
119
132
|
}),
|
|
120
|
-
roundedCorners:
|
|
133
|
+
roundedCorners: P({
|
|
121
134
|
title: "Rounded Corner",
|
|
122
135
|
default: parseInt(O || 5, 10)
|
|
123
136
|
}),
|
|
124
|
-
primaryColor:
|
|
125
|
-
secondaryColor:
|
|
137
|
+
primaryColor: a({ title: "Primary", default: x }),
|
|
138
|
+
secondaryColor: a({ title: "Secondary", default: S })
|
|
126
139
|
};
|
|
127
|
-
|
|
140
|
+
d || (r = {
|
|
128
141
|
...r,
|
|
129
|
-
bodyBgLightColor:
|
|
142
|
+
bodyBgLightColor: a({
|
|
130
143
|
title: "Body Background (Light Mode)",
|
|
131
144
|
default: B
|
|
132
145
|
}),
|
|
133
|
-
bodyTextLightColor:
|
|
146
|
+
bodyTextLightColor: a({
|
|
134
147
|
title: "Body Text (Light Mode)",
|
|
135
148
|
default: y
|
|
136
149
|
}),
|
|
137
|
-
bodyBgDarkColor:
|
|
150
|
+
bodyBgDarkColor: a({
|
|
138
151
|
title: "Body Background (Dark mode)",
|
|
139
152
|
default: C
|
|
140
153
|
}),
|
|
141
|
-
bodyTextDarkColor:
|
|
154
|
+
bodyTextDarkColor: a({
|
|
142
155
|
title: "Body Text (Dark mode)",
|
|
143
156
|
default: b
|
|
144
157
|
})
|
|
@@ -147,15 +160,15 @@ const F = ({ value: u, onChange: e, id: d, onBlur: p }) => {
|
|
|
147
160
|
type: "object",
|
|
148
161
|
properties: {}
|
|
149
162
|
}, v = {};
|
|
150
|
-
return Object.keys(r).forEach((
|
|
151
|
-
const s = r[
|
|
152
|
-
return n.properties || (n.properties = {}), n.properties[
|
|
163
|
+
return Object.keys(r).forEach((o) => {
|
|
164
|
+
const s = r[o];
|
|
165
|
+
return n.properties || (n.properties = {}), n.properties[o] = s.schema, v[o] = s.uiSchema, !0;
|
|
153
166
|
}), /* @__PURE__ */ t.jsxs("div", { className: "flex h-full w-60 select-none flex-col", children: [
|
|
154
167
|
/* @__PURE__ */ t.jsx("div", { className: "rounded-md bg-background/30 p-1", children: /* @__PURE__ */ t.jsx("h1", { className: "px-1 font-semibold", children: "Branding Options" }) }),
|
|
155
168
|
/* @__PURE__ */ t.jsx("div", { className: "-mx-2", children: /* @__PURE__ */ t.jsx(
|
|
156
169
|
j,
|
|
157
170
|
{
|
|
158
|
-
widgets: { color:
|
|
171
|
+
widgets: { color: M },
|
|
159
172
|
idSeparator: ".",
|
|
160
173
|
autoComplete: "off",
|
|
161
174
|
omitExtraData: !0,
|
|
@@ -171,5 +184,5 @@ const F = ({ value: u, onChange: e, id: d, onBlur: p }) => {
|
|
|
171
184
|
] });
|
|
172
185
|
};
|
|
173
186
|
export {
|
|
174
|
-
|
|
187
|
+
Ct as default
|
|
175
188
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";var ne=Object.defineProperty;var oe=(e,t,s)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var A=(e,t,s)=>(oe(e,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-Z_BpKhVy.cjs"),p=require("react"),c=require("lodash-es"),w=require("@radix-ui/react-icons"),o=require("./index-F4AQQ6qq.cjs"),L=require("react-i18next"),B=require("jotai"),z=require("react-dom"),R=require("prop-types"),ie=require("react-quill"),Z=require("flagged"),re=require("@floating-ui/dom"),W=require("@floating-ui/react-dom"),le=require("@react-hookz/web"),ae=require("@bobthered/tailwindcss-palette-generator"),ce=require("@tailwindcss/typography"),de=require("@tailwindcss/forms"),ue=require("@tailwindcss/aspect-ratio"),pe=require("react-wrap-balancer"),xe=require("tailwind-merge"),q=require("./MODIFIERS-9EwxLM8V.cjs"),me=require("@chaibuilder/runtime"),O=require("./index-l19JVVXI.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("./Class-MmCxz2Ay.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("i18next");require("react-hotkeys-hook");const ge=()=>{const{hasUndo:e,hasRedo:t,undo:s,redo:l}=o.useUndoManager();return n.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[n.jsxRuntimeExports.jsx(o.Button,{disabled:!e(),size:"sm",onClick:s,className:"rounded-full",variant:"ghost",children:n.jsxRuntimeExports.jsx(w.ResetIcon,{})}),n.jsxRuntimeExports.jsx(o.Button,{disabled:!t(),onClick:l,size:"sm",className:"rounded-full",variant:"ghost",children:n.jsxRuntimeExports.jsx(w.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function he(){const[e,t]=o.useDarkMode(),{t:s}=L.useTranslation();return n.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[n.jsxRuntimeExports.jsx(o.Label,{htmlFor:"dark-mode-switch",children:s("dark_mode")}),n.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:[n.jsxRuntimeExports.jsx("span",{className:"sr-only",children:s("use_setting")}),n.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 K=({landscape:e=!1})=>n.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:[n.jsxRuntimeExports.jsx("g",{strokeWidth:0}),n.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),n.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"}})]}),fe=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:n.jsxRuntimeExports.jsx(w.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:n.jsxRuntimeExports.jsx(w.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:n.jsxRuntimeExports.jsx(K,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:n.jsxRuntimeExports.jsx(K,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:n.jsxRuntimeExports.jsx(w.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:n.jsxRuntimeExports.jsx(w.DesktopIcon,{}),width:1920}],Y=({title:e,content:t,currentBreakpoint:s,breakpoint:l,width:a,icon:r,onClick:u})=>{const{t:i}=L.useTranslation();return n.jsxRuntimeExports.jsxs(o.HoverCard,{children:[n.jsxRuntimeExports.jsx(o.HoverCardTrigger,{asChild:!0,children:n.jsxRuntimeExports.jsx(o.Button,{onClick:()=>u(a),size:"sm",variant:l===s?"secondary":"ghost",children:r})}),n.jsxRuntimeExports.jsx(o.HoverCardContent,{className:"w-52 border-border",children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:n.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[n.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:i(e)}),n.jsxRuntimeExports.jsx("p",{className:"text-xs",children:i(t)})]})})})]})},je=()=>{const[,e,t]=o.useCanvasWidth(),[s,l]=o.useSelectedBreakpoints(),{t:a}=L.useTranslation(),r=o.useBuilderProp("breakpoints",fe),u=i=>{s.includes(i)?s.length>2&&l(s.filter(d=>d!==i)):l(d=>[...d,i])};return r.length<4?n.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:c.map(r,i=>p.createElement(Y,{...i,onClick:t,key:i.breakpoint,currentBreakpoint:e}))}):n.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[c.map(r.filter(i=>c.includes(s,c.toUpper(i.breakpoint))),i=>p.createElement(Y,{...i,onClick:t,key:i.breakpoint,currentBreakpoint:e})),n.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[n.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:n.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:n.jsxRuntimeExports.jsx(w.DotsVerticalIcon,{className:"scale-90 transform"})})}),n.jsxRuntimeExports.jsxs(o.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[n.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:a("Breakpoints")}),n.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),c.map(r,i=>n.jsxRuntimeExports.jsx(o.DropdownMenuCheckboxItem,{disabled:i.breakpoint==="xs",onCheckedChange:()=>u(c.toUpper(i.breakpoint)),checked:c.includes(s,c.toUpper(i.breakpoint)),children:a(i.title)},i.breakpoint))]})]})]})},ye=()=>{const{t:e}=L.useTranslation(),{setNewBlocks:t}=o.useBlocksStoreUndoableActions(),[,s]=o.useSelectedBlockIds(),[,l]=o.useSelectedStylingBlocks(),a=p.useCallback(()=>{t([]),s([]),l([])},[t]);return n.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:n.jsxRuntimeExports.jsxs(o.AlertDialog,{children:[n.jsxRuntimeExports.jsx(o.AlertDialogTrigger,{asChild:!0,children:n.jsxRuntimeExports.jsxs(o.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[n.jsxRuntimeExports.jsx(w.EraserIcon,{})," ",e("clear")]})}),n.jsxRuntimeExports.jsxs(o.AlertDialogContent,{className:"border-border",children:[n.jsxRuntimeExports.jsxs(o.AlertDialogHeader,{children:[n.jsxRuntimeExports.jsx(o.AlertDialogTitle,{children:e("clear_canvas_title")}),n.jsxRuntimeExports.jsx(o.AlertDialogDescription,{children:e("clear_canvas_description")})]}),n.jsxRuntimeExports.jsxs(o.AlertDialogFooter,{children:[n.jsxRuntimeExports.jsx(o.AlertDialogCancel,{children:e("cancel")}),n.jsxRuntimeExports.jsx(o.AlertDialogAction,{onClick:a,children:e("yes")})]})]})]})})},Ee=()=>{const e=o.useBuilderProp("darkMode",!1),[t]=o.useCanvasZoom();return n.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[n.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[e?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(he,{}),n.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"})]}):null,n.jsxRuntimeExports.jsx(je,{}),n.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),n.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[n.jsxRuntimeExports.jsx(w.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",n.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[c.round(t,0),"%"]})]}),n.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),n.jsxRuntimeExports.jsx(ge,{})]}),n.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[n.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),n.jsxRuntimeExports.jsx(ye,{})]})]})},ke=`<!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://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"><\/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
|
+
.frame-root .frame-content { height: 100%; }
|
|
39
|
+
</style>
|
|
40
|
+
<style id="hidden-blocks"></style>
|
|
41
|
+
<style id="selected-block"></style>
|
|
42
|
+
<style id="selected-styling-block"></style>
|
|
43
|
+
<style id="highlighted-block"></style>
|
|
44
|
+
<style id="dragged-block"></style>
|
|
45
|
+
|
|
46
|
+
</head>
|
|
47
|
+
<body class="font-body antialiased h-full">
|
|
48
|
+
<div class="frame-root h-full"></div>
|
|
49
|
+
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
50
|
+
</body>
|
|
51
|
+
</html>`,ve=e=>{const[t]=o.useCanvasWidth(),[,s]=o.useCanvasZoom(),[l,a]=p.useState({}),r=p.useCallback(()=>{const{width:u,height:i}=e;if(u<t){const d=parseFloat((u/t).toFixed(2).toString());let x={};const m=i*d;i&&(x={height:100+(i-m)/m*100+"%"}),a({position:"relative",top:0,transform:`scale(${d})`,transformOrigin:"top left",...x,maxWidth:"none"}),s(d*100)}else a({}),s(100)},[t,e,s]);return p.useEffect(()=>{r()},[t,e,s,r]),l};let Q,G;typeof document<"u"&&(Q=document);typeof window<"u"&&(G=window);const J=p.createContext({document:Q,window:G}),$=()=>p.useContext(J),{Provider:be,Consumer:Ge}=J;class X extends p.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return p.Children.only(this.props.children)}}A(X,"propTypes",{children:R.element.isRequired,contentDidMount:R.func.isRequired,contentDidUpdate:R.func.isRequired});class F extends p.Component{constructor(s,l){super(s,l);A(this,"setRef",s=>{this.nodeRef.current=s;const{forwardedRef:l}=this.props;typeof l=="function"?l(s):l&&(l.current=s)});A(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});A(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=p.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 s=this.getDoc();return this.props.mountTarget?s.querySelector(this.props.mountTarget):s.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const s=this.getDoc();if(!s)return null;const l=this.props.contentDidMount,a=this.props.contentDidUpdate,r=s.defaultView||s.parentView,u=n.jsxRuntimeExports.jsx(X,{contentDidMount:l,contentDidUpdate:a,children:n.jsxRuntimeExports.jsx(be,{value:{document:s,window:r},children:n.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),i=this.getMountTarget();return[z.createPortal(this.props.head,this.getDoc().head),z.createPortal(u,i)]}render(){const s={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete s.head,delete s.initialContent,delete s.mountTarget,delete s.contentDidMount,delete s.contentDidUpdate,delete s.forwardedRef,n.jsxRuntimeExports.jsx("iframe",{...s,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}A(F,"propTypes",{style:R.object,head:R.node,initialContent:R.string,mountTarget:R.string,contentDidMount:R.func,contentDidUpdate:R.func,children:R.oneOfType([R.element,R.arrayOf(R.element)])}),A(F,"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 Re=p.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(F,{...e,forwardedRef:t})),we=()=>{const{addCoreBlock:e}=o.useAddBlock(),t=o.useBuilderProp("getExternalPredefinedBlock",c.noop);return p.useCallback(async s=>{const{block:l,dropTargetId:a,relativeIndex:r}=s;if(c.has(l,"format")){const u=await t(l);return e({blocks:u},a===0?null:a,r)}return e(l,a===0?null:a,r)},[e])};let I=null,T=[],M=null,ee=null;function Be(e){const t=window.getComputedStyle(e),s=parseInt(t.paddingLeft,10),l=parseInt(t.paddingTop,10),a=parseInt(t.paddingRight,10),r=parseInt(t.paddingBottom,10);return{paddingLeft:s,paddingTop:l,paddingRight:a,paddingBottom:r}}const V=(e,t,s)=>{if(!I)return;const l=e.getBoundingClientRect(),a=I==null?void 0:I.getElementById("placeholder"),{paddingLeft:r,paddingTop:u,paddingRight:i,paddingBottom:d}=Be(e);a.style.width=t==="vertical"?l.width-r-i+"px":"2px",a.style.height=t==="vertical"?"2px":l.height-u-d+"px",a.style.display="block";const x=T.reduce((m,f)=>Math.abs(f-s)<Math.abs(m-s)?f:m);ee=T.indexOf(x),t==="vertical"?(a.style.top=e.offsetTop+x+"px",a.style.left=e.offsetLeft+r+"px"):(a.style.top=e.offsetTop+u+"px",a.style.left=e.offsetLeft+x+"px")},Se=e=>{const t=te(e),s=window.getComputedStyle(e),l=t==="horizontal",a=parseInt(s.paddingLeft),r=parseInt(s.paddingTop);let u=l?a:r;T=[u],Array.from(e.children).forEach(i=>{const d=window.getComputedStyle(i),x=parseInt(l?d.marginLeft+d.marginRight:d.marginTop+d.marginBottom),m=l?i.offsetWidth:i.offsetHeight;T.push(u+m+x),u+=m+x})};function te(e){const t=window.getComputedStyle(e).display,s=window.getComputedStyle(e).flexDirection;if(t==="flex")return s==="column"||s==="column-reverse"?"vertical":"horizontal";if(t==="grid"){const l=window.getComputedStyle(e).gridTemplateRows,a=window.getComputedStyle(e).gridTemplateColumns;if(l.includes("auto"))return"vertical";if(a.includes("auto"))return"horizontal"}return t==="block"?"vertical":"horizontal"}const Ce=c.throttle(e=>{const t=e.target,s=te(t);if(s==="vertical"){const l=e.clientY-t.offsetTop;V(t,s,l)}else{const l=e.clientX-t.offsetLeft;V(t,s,l)}},200),Ie=e=>{e.preventDefault(),e.stopPropagation(),Ce(e)};function P(){const e=I==null?void 0:I.getElementById("placeholder");e.style.display="none"}const De=()=>{const{document:e}=$(),[t,s]=B.useAtom(o.draggingFlagAtom),l=we(),a=Z.useFeature("dnd"),[,r]=o.useHighlightBlockId(),[,u]=o.useSelectedBlockIds();return I=e,{isDragging:t,"data-dnd":"branch",onDragOver:a?Ie:c.noop,onDrop:a?i=>{M==null||M.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2");const d=JSON.parse(i.dataTransfer.getData("text/plain"));let x=i.target.getAttribute("data-block-id");x===null&&(x=i.target.parentElement.getAttribute("data-block-id")),l({block:d,dropTargetId:x||null,relativeIndex:ee}),s(!1),P(),setTimeout(()=>{P()},300)}:c.noop,onDragEnter:a?i=>{const d=i;M=d.target,d.stopPropagation(),d.preventDefault(),T=[];const x=d.target;Se(x),x.classList.add("outline","outline-green-300","outline-2","-outline-offset-2"),s(!0),r(""),u([])}:c.noop,onDragLeave:a?i=>{const d=i;M=null,d.stopPropagation(),d.preventDefault(),d.target.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2")}:c.noop,onMouseOut:a?()=>{s(!1),P()}:c.noop}};function U(e){return e.getAttribute("data-block-id")?e:e.closest("[data-block-id]")}function Ae(e){e.container.innerHTML="",e.container.parentNode.removeChild(e.container);var t=document.querySelector(".ql-toolbar");t&&t.parentNode.removeChild(t),e=null}const _e=()=>{const e=["Heading","Paragraph","Text","Link","Span","Button"],t=o.useUpdateBlocksProps(),[,s]=o.useHighlightBlockId(),[l,a]=B.useAtom(o.inlineEditingActiveAtom);return r=>{var f;if(l)return;const u=U(r.target),i=u.getAttribute("data-block-type");if(!i||!e.includes(i))return;const d=u.cloneNode(!0);u.style.display="none",Array.from(d.attributes).forEach(j=>{j.name!=="class"&&d.removeAttribute(j.name)}),i==="Text"&&(d.style.display="inline-block"),u.parentNode.insertBefore(d,u.nextSibling);const x=new ie.Quill(d,{placeholder:"Type here..."});function m(){const j=x.getText(0,x.getLength());t([u.getAttribute("data-block-id")],{content:j}),u.removeAttribute("style"),d.removeEventListener("blur",m,!0),Ae(x),a(""),s("")}d.addEventListener("blur",m,!0),x.focus(),(f=d.querySelector(".ql-clipboard"))==null||f.remove(),a(u.getAttribute("data-block-id"))}},Me=()=>{const[,e]=o.useSelectedStylingBlocks(),[,t]=o.useSelectedBlockIds(),[,s]=o.useHighlightBlockId(),[l]=B.useAtom(o.inlineEditingActiveAtom);return a=>{if(l)return;a.stopPropagation();const r=U(a.target);if(r!=null&&r.getAttribute("data-block-id")&&(r==null?void 0:r.getAttribute("data-block-id"))==="container"){t([]),e([]),s("");return}if(r!=null&&r.getAttribute("data-block-parent")){const u=r.getAttribute("data-style-prop"),i=r.getAttribute("data-style-id"),d=r.getAttribute("data-block-parent");e([{id:i,prop:u,blockId:d}]),t([d])}else r!=null&&r.getAttribute("data-block-id")&&t([r.getAttribute("data-block-id")]);s("")}},Te=c.throttle((e,t)=>{const s=U(e.target);s!=null&&s.getAttribute("data-style-id")&&t(s.getAttribute("data-style-id"))},100),Ne=()=>{const[,e]=o.useHighlightBlockId(),[t]=B.useAtom(o.inlineEditingActiveAtom);return s=>{t||Te(s,e)}},qe=({children:e})=>{const{document:t}=$(),[s]=o.useSelectedBlockIds(),[l,a]=o.useSelectedStylingBlocks();p.useEffect(()=>{setTimeout(()=>{if(!c.isEmpty(l))return;const x=se(t,c.first(s));if(x){const m=x.getAttribute("data-style-prop");if(m){const f=x.getAttribute("data-style-id"),j=x.getAttribute("data-block-parent");a([{id:f,prop:m,blockId:j}])}}},100)},[t,s,a,l]);const r=_e(),u=Me(),i=Ne(),d=De();return n.jsxRuntimeExports.jsx("div",{"data-block-id":"container",id:"canvas",onClick:u,onDoubleClick:r,onMouseMove:i,...c.omit(d,"isDragging"),className:"relative mb-5 h-full max-w-full "+(d.isDragging?"dragging":""),children:e})},se=(e,t)=>e.querySelector(`[data-block-id="${t}"]`),Le=()=>{const{window:e}=$(),[t,s]=o.useSelectedBlockIds(),[l]=o.useBlocksStore(),[,a]=o.useSelectedStylingBlocks(),{undo:r,redo:u}=o.useUndoManager(),i=o.useDuplicateBlocks(),[,d]=o.usePreviewMode(),x=o.useRemoveBlocks(),{savePage:m}=o.useSavePage(),[f]=B.useAtom(o.inlineEditingActiveAtom),[,j]=B.useAtom(o.editLayerNameAtom),b=y=>{y.key==="Enter"&&(y.preventDefault(),t.length===1&&j(c.first(t)))},S=y=>{const h=l.find(v=>v._id===y);return h?h._parent:null};return p.useEffect(()=>{const y=h=>{if(h.key==="Escape"){s([]),a([]);return}if(b(h),!f&&(h.key==="Delete"||h.key==="Backspace")&&(h.preventDefault(),x(t)),h.ctrlKey||h.metaKey){if(h.key==="ArrowUp"){h.preventDefault();const v=t.length>0?S(t[0]):null;v&&s([v])}if(["z","y","d","x","c","p","s","v"].includes(h.key)){if(f&&["x","z","v"].includes(h.key))return!0;h.preventDefault()}h.key==="s"&&(h.stopPropagation(),h.preventDefault(),m()),h.key==="z"&&r(),h.key==="y"&&u(),h.key==="d"&&i(t)}};return e.removeEventListener("keydown",y),e.addEventListener("keydown",y),()=>{e.removeEventListener("keydown",y)}},[t,s,r,x,d,u,i,f,m,e]),null},$e=({block:e,label:t})=>{const[,s]=o.useSelectedBlockIds(),[,l]=o.useHighlightBlockId(),[,a]=B.useAtom(o.draggedBlockIdAtom),r=Z.useFeature("dnd");return n.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",draggable:r?"true":"false",onDragStart:u=>{u.dataTransfer.setData("text/plain",JSON.stringify(c.pick(e,["_id","_type"]))),a(e._id),setTimeout(()=>{s([]),l(null)},200)},children:[n.jsxRuntimeExports.jsx(w.DragHandleDots2Icon,{}),t]})},Pe=({selectedBlockElement:e,block:t})=>{const s=o.useRemoveBlocks(),l=o.useDuplicateBlocks(),[,a]=o.useSelectedBlockIds(),[,r]=o.useSelectedStylingBlocks(),[u]=B.useAtom(o.inlineEditingActiveAtom),{floatingStyles:i,refs:d,update:x}=W.useFloating({placement:"top-start",middleware:[W.shift(),re.flip()],elements:{reference:e}});le.useResizeObserver(e,()=>x(),e!==null);const m=c.get(t,"_parent",null),f=c.isEmpty(c.get(t,"_name",""))?c.get(t,"_type",""):c.get(t,"_name","");return!e||!t||u?null:n.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:i,onClick:j=>{j.stopPropagation(),j.preventDefault()},onKeyDown:j=>j.stopPropagation(),className:"z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[n.jsxRuntimeExports.jsx($e,{label:f,block:t}),n.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[m&&n.jsxRuntimeExports.jsx(w.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{r([]),a([m])}}),o.canDuplicateBlock(c.get(t,"_type",""))?n.jsxRuntimeExports.jsx(w.CopyIcon,{className:"hover:scale-105",onClick:()=>l([t==null?void 0:t._id])}):null,o.canDeleteBlock(c.get(t,"_type",""))?n.jsxRuntimeExports.jsx(w.TrashIcon,{className:"hover:scale-105",onClick:()=>s([t==null?void 0:t._id])}):null]})]})},Fe=({model:e})=>{const[t]=o.useBrandingOptions(),[s]=o.useSelectedBlockIds(),[l]=o.useDarkMode(),[a]=o.useHighlightBlockId(),[r]=o.useSelectedStylingBlocks(),[u]=B.useAtom(o.draggedBlockIdAtom),{document:i,window:d}=$(),[x]=p.useState(i==null?void 0:i.getElementById("highlighted-block")),[m]=p.useState(i==null?void 0:i.getElementById("selected-block")),[f]=p.useState(i==null?void 0:i.getElementById("selected-styling-block")),[j]=p.useState(i==null?void 0:i.getElementById("dragged-block"));p.useEffect(()=>{l?i==null||i.documentElement.classList.add("dark"):i==null||i.documentElement.classList.remove("dark")},[l,i]);const b=c.get(t,"headingFont","DM Sans"),S=c.get(t,"bodyFont","DM Sans");return p.useEffect(()=>{const y=c.get(t,"primaryColor","#000"),h=c.get(t,"secondaryColor","#FFF"),v=ae.tailwindcssPaletteGenerator({colors:[y,h],names:["primary","secondary"]});v.primary.DEFAULT=y,v.secondary.DEFAULT=h;const _=c.get(t,"roundedCorners","0");!d||!d.tailwind||(d.tailwind.config={darkMode:"class",theme:{fontFamily:{heading:[b],body:[S]},extend:{borderRadius:{global:`${_||"0"}px`},colors:v}},plugins:[ce,de,ue,d.tailwind.plugin.withOptions(()=>({addVariant:N,e:C})=>{N("hs-accordion-active",[({modifySelectors:k,separator:g})=>{k(({className:E})=>`.hs-accordion.active.${C(`hs-accordion-active${g}${E}`)}`)},({modifySelectors:k,separator:g})=>{k(({className:E})=>`.hs-accordion.active > .${C(`hs-accordion-active${g}${E}`)}`)},({modifySelectors:k,separator:g})=>{k(({className:E})=>`.hs-accordion.active > .hs-accordion-toggle .${C(`hs-accordion-active${g}${E}`)}`)},({modifySelectors:k,separator:g})=>{k(({className:E})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${C(`hs-accordion-active${g}${E}`)}`)},({modifySelectors:k,separator:g})=>{k(({className:E})=>`.hs-accordion.active > .hs-accordion-toggle.${C(`hs-accordion-active${g}${E}`)}`)},({modifySelectors:k,separator:g})=>{k(({className:E})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${C(`hs-accordion-active${g}${E}`)}`)}]),N("hs-accordion-selected",({modifySelectors:k,separator:g})=>{k(({className:E})=>`.hs-accordion .selected.${C(`hs-accordion-selected${g}${E}`)}`)})})]})},[t,d,b,S]),p.useEffect(()=>{m&&(m.textContent=`${c.map(s,y=>`[data-block-id="${y}"]`).join(",")}{
|
|
52
|
+
outline: 1px solid ${s.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
|
|
53
|
+
}`)},[s,m]),p.useEffect(()=>{if(!u){j.textContent="";return}j.textContent=`[data-block-id="${u}"]{ pointer-events: none !important; opacity: 0.2 !important}`},[u]),p.useEffect(()=>{x&&(x.textContent=a?`[data-style-id="${a}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}`:"")},[a,s,x]),p.useEffect(()=>{f&&(f.textContent=`${c.map(r,({id:y})=>`[data-style-id="${y}"]`).join(",")}{
|
|
54
|
+
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
55
|
+
}`)},[r,f]),p.useEffect(()=>{const y=c.get(t,"bodyTextLightColor","#64748b"),h=c.get(t,"bodyTextDarkColor","#94a3b8"),v=c.get(t,"bodyBgLightColor","#FFFFFF"),_=c.get(t,"bodyBgDarkColor","#0f172a");i.body.className=`font-body antialiased text-[${y}] bg-[${v}] dark:text-[${h}] dark:bg-[${_}]`},[t,i,e]),e==="page"?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[b&&n.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"}),S&&b!==S&&n.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${S.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),b&&n.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},He=e=>{const t={};return Object.keys(e).forEach(s=>{c.isString(e[s])&&e[s].startsWith(q.SLOT_KEY)&&(t[s]=e[s].replace(q.SLOT_KEY,"").split(","))}),t},Oe=c.memoize(e=>{const t=e.replace(q.STYLES_KEY,"").split(",");return xe.twMerge(t[0],t[1])});function Ue(e,t){return c.get(e,`${t}_attrs`,{})}function ze(e){const t={};return Object.keys(e).forEach(s=>{if(c.isString(e[s])&&e[s].startsWith(q.STYLES_KEY)){const l=Oe(e[s]);t[s]={className:l,"data-style-prop":s,"data-block-parent":e._id,"data-style-id":`${s}-${e._id}`,...Ue(e,s)}}}),t}function We(e,t){const s=c.get(e,"_bindings",{});return c.isEmpty(s)?{...e}:(c.each(s,(l,a)=>{c.isString(l)&&c.get(t,l,null)&&(e[a]=c.get(t,l,null))}),e)}function H({blocks:e}){const[t]=o.useBlocksStore(),s=p.useCallback(r=>ze(r),[]),[l]=O.useChaiExternalData(),[a]=B.useAtom(o.inlineEditingActiveAtom);return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:p.Children.toArray(e.map((r,u)=>{if(a===r._id)return null;const i=He(r),d={};c.isEmpty(i)||Object.keys(i).forEach(j=>{d[j]=p.Children.toArray(i[j].map(b=>n.jsxRuntimeExports.jsx(H,{blocks:[c.find(t,{_id:b})]})))});const x=c.filter(t,{_parent:r._id});d.children=x.length?n.jsxRuntimeExports.jsx(H,{blocks:x}):null;const m=me.getBlockComponent(r._type),f=c.get(m,"builderComponent",c.get(m,"component",null));return c.isNull(f)?n.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${r==null?void 0:r._type} not registered -->`}):n.jsxRuntimeExports.jsx(p.Suspense,{children:p.createElement(f,{blockProps:{"data-block-id":r._id,"data-block-type":r._type,"data-dnd":c.has(m,"canAcceptBlock")?"branch":"leaf"},inBuilder:!0,index:u,...We(r,l),...s(r),...d})})}))})}const Ke=()=>{const[e]=o.useBlocksStore(),t=c.isEmpty(e)?null:n.jsxRuntimeExports.jsx(O.BlocksExternalDataProvider,{children:n.jsxRuntimeExports.jsx(H,{blocks:c.filter(e,s=>c.isEmpty(s._parent))})});return n.jsxRuntimeExports.jsx(pe.Provider,{children:t})},Ye=(e,t)=>e.querySelector(`[data-style-id="${t}"]`),Ve=()=>{const[e]=B.useAtom(o.networkModeAtom),[t]=o.usePreviewMode(),[s]=o.useCanvasWidth(),[,l]=o.useSelectedBlockIds(),a=o.useSelectedBlock(),[,r]=o.useHighlightBlockId(),u=p.useRef(null),i=p.useRef(null),[d,x]=p.useState({width:0,height:0}),m=ve(d),[f,j]=p.useState(0),[b,S]=p.useState([]),[,y]=p.useState([]),[,h]=B.useAtom(o.canvasIframeAtom),[v,_]=o.useSelectedStylingBlocks(),N=o.useBuilderProp("loading",!1);p.useEffect(()=>{const{clientWidth:g,clientHeight:E}=i.current;x({width:g,height:E}),f===0&&j(g)},[i,s,f]);const C=(g,E=0)=>{const{top:D}=g.getBoundingClientRect();return D+E>=0&&D-E<=window.innerHeight};p.useEffect(()=>{var g,E;if(a&&a.type!=="Multiple"&&u.current){const D=se(u.current.contentDocument,a._id);D&&(C(D)||(E=(g=u.current)==null?void 0:g.contentWindow)==null||E.scrollTo({top:D.offsetTop,behavior:"smooth"}),S([D]))}},[a]),p.useEffect(()=>{if(!c.isEmpty(v)&&u.current){const g=Ye(u.current.contentDocument,c.first(v).id);y(g?[g]:[null])}else y([null])},[v]);const k=p.useMemo(()=>{let g=ke;return e==="offline"&&(g=g.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),g=g.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),g=g.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),g},[e]);return n.jsxRuntimeExports.jsx("div",{onClick:()=>{l([]),_([])},onMouseLeave:()=>setTimeout(()=>r(""),300),className:"relative mx-auto h-full w-full overflow-hidden",style:f>0&&!c.isEmpty(m)?{width:t?"100%":f}:{},ref:i,children:n.jsxRuntimeExports.jsxs(Re,{contentDidMount:()=>h(u.current),ref:u,id:"canvas-iframe",style:{width:`${s}px`,...m},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:k,children:[n.jsxRuntimeExports.jsx(Le,{}),n.jsxRuntimeExports.jsx(Pe,{block:a,selectedBlockElement:c.first(b)}),n.jsxRuntimeExports.jsx(Fe,{model:"page"}),n.jsxRuntimeExports.jsx(qe,{children:N?n.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:n.jsxRuntimeExports.jsx(o.Skeleton,{className:"h-full"})}):n.jsxRuntimeExports.jsx(Ke,{})}),n.jsxRuntimeExports.jsx("br",{}),n.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})},Ze=()=>n.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[n.jsxRuntimeExports.jsx(Ee,{}),n.jsxRuntimeExports.jsx("div",{className:"relative h-full overflow-hidden bg-slate-800/90 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] px-2",children:n.jsxRuntimeExports.jsx(p.Suspense,{fallback:n.jsxRuntimeExports.jsx(o.Skeleton,{className:"h-full"}),children:n.jsxRuntimeExports.jsx(O.ErrorBoundary,{children:n.jsxRuntimeExports.jsx(Ve,{})})})})]});exports.default=Ze;
|