@chaibuilder/sdk 1.1.11 → 1.1.12
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/{CanvasArea-_eT3OREW.cjs → CanvasArea-OXK5ZBHd.cjs} +3 -3
- package/dist/{CanvasArea-zAT94LPr.js → CanvasArea-RGTkdcs7.js} +46 -40
- package/dist/{CurrentPage-awyWzrD1.js → CurrentPage-8mHwqtUF.js} +1 -1
- package/dist/{CurrentPage-J3WuljO3.cjs → CurrentPage-PrMEc3YN.cjs} +1 -1
- package/dist/{Layers-Iu48BWko.js → Layers-BjP8kxlY.js} +1 -1
- package/dist/{Layers-SkyPSf1R.cjs → Layers-zYr-uaHA.cjs} +1 -1
- package/dist/{PagesPanel-dzL5sq6p.cjs → PagesPanel-23_rqlAI.cjs} +1 -1
- package/dist/{PagesPanel-FiGBY1m8.js → PagesPanel-gwiGbDKn.js} +2 -2
- package/dist/{ProjectPanel-uOP0fGfw.cjs → ProjectPanel-faZxtDbA.cjs} +1 -1
- package/dist/{ProjectPanel-c5QlZgrp.js → ProjectPanel-ruWizkTT.js} +2 -2
- package/dist/{Settings-QxjYc9wt.cjs → Settings-RjUeZe8o.cjs} +1 -1
- package/dist/{Settings-FuvoLEbx.js → Settings-WtHFLTVf.js} +1 -1
- package/dist/{SidePanels-9tKSnDxd.cjs → SidePanels-7GPjyIEE.cjs} +1 -1
- package/dist/{SidePanels-2FjCLw9X.js → SidePanels-Hxu9nfmz.js} +2 -2
- package/dist/{add-page-modal-o4WyfyUe.js → add-page-modal-God3usfm.js} +1 -1
- package/dist/{add-page-modal-1ied5RTu.cjs → add-page-modal-HyQBukId.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-fKBafNSA.cjs → delete-page-modal-L2P69sjk.cjs} +1 -1
- package/dist/{delete-page-modal-pWTbYmMV.js → delete-page-modal-Whkna9tP.js} +1 -1
- package/dist/{index-kVugkp77.cjs → index-OgEmBQj6.cjs} +1 -1
- package/dist/{index-RYlMCgpN.js → index-TP8jhZbU.js} +2 -2
- package/dist/{page-viewer-_mpbB5Lr.cjs → page-viewer-3X3bD4I6.cjs} +1 -1
- package/dist/{page-viewer-CijLLu6R.js → page-viewer-xv8TBR-B.js} +2 -2
- package/dist/{project-general-setting-rHyDn0aW.js → project-general-setting-AIICdB3T.js} +1 -1
- package/dist/{project-general-setting-gwcHJ-ow.cjs → project-general-setting-IJFP4L0Q.cjs} +1 -1
- package/dist/{single-page-detail-aNLmbldV.cjs → single-page-detail-7-lC8BG1.cjs} +1 -1
- package/dist/{single-page-detail-UUVe4WYc.js → single-page-detail-D2NIiDP6.js} +2 -2
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var We=Object.defineProperty;var $e=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-WUGKV8jN.cjs"),m=require("react"),x=require("lodash"),L=require("@radix-ui/react-icons"),r=require("./index-MIe2pKhn.cjs"),Ue=require("react-i18next"),H=require("jotai"),he=require("react-dom"),Z=require("./MODIFIERS-WFzDQfiT.cjs"),Q=require("./index-
|
|
1
|
+
"use strict";var We=Object.defineProperty;var $e=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-WUGKV8jN.cjs"),m=require("react"),x=require("lodash"),L=require("@radix-ui/react-icons"),r=require("./index-MIe2pKhn.cjs"),Ue=require("react-i18next"),H=require("jotai"),he=require("react-dom"),Z=require("./MODIFIERS-WFzDQfiT.cjs"),Q=require("./index-OgEmBQj6.cjs"),ze=require("react-quill"),Ye=require("./useAddBlockByDrop-8i3iNtPF.cjs"),Se=require("flagged"),Ke=require("@floating-ui/dom"),ge=require("@floating-ui/react-dom"),Je=require("@react-hookz/web"),Xe=require("@bobthered/tailwindcss-palette-generator"),Ve=require("react-wrap-balancer"),Ze=require("tailwind-merge"),Ge=require("@chaibuilder/runtime");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.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("redux-undo");require("i18next");require("react-textarea-autosize");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const Qe=()=>{const{undoCount:e,redoCount:t,undo:n,redo:a}=r.useCanvasHistory();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(r.Button,{disabled:!e,size:"sm",onClick:n,className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{})}),s.jsxRuntimeExports.jsx(r.Button,{disabled:!t,onClick:a,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function et(){const[e,t]=r.useDarkMode(),{t:n}=Ue.useTranslation();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(r.Label,{htmlFor:"dark-mode-switch",children:n("dark_mode")}),s.jsxRuntimeExports.jsxs(r.Switch,{id:"dark-mode-switch",checked:e,onCheckedChange:()=>{t(!e)},className:`${e?"bg-violet-600":"bg-violet-300"}
|
|
2
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:"Use setting"}),s.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${e?"translate-x-5":"translate-x-0"}
|
|
3
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 me=({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"}})]}),ye=[{title:"Mobile (XS)",content:"Styles set here are applied to all screen unless edited at higher breakpoint",breakpoint:"xs",icon:s.jsxRuntimeExports.jsx(L.MobileIcon,{}),width:400},{title:"Mobile landscape (SM)",content:"Styles set here are applied at 640px and up unless edited at higher breakpoint",breakpoint:"sm",icon:s.jsxRuntimeExports.jsx(L.MobileIcon,{className:"rotate-90"}),width:640},{title:"Tablet (MD)",content:"Styles set here are applied at 768px and up",breakpoint:"md",icon:s.jsxRuntimeExports.jsx(me,{}),width:800},{title:"Tablet Landscape (LG)",content:"Styles set here are applied at 1024px and up unless edited at higher breakpoint",breakpoint:"lg",icon:s.jsxRuntimeExports.jsx(me,{landscape:!0}),width:1024},{title:"Desktop (XL)",content:"Styles set here are applied at 1280px and up unless edited at higher breakpoint",breakpoint:"xl",icon:s.jsxRuntimeExports.jsx(L.LaptopIcon,{}),width:1420},{title:"Large Desktop (2XL)",content:"Styles set here are applied at 1536px and up",breakpoint:"2xl",icon:s.jsxRuntimeExports.jsx(L.DesktopIcon,{}),width:1920}],tt=({title:e,content:t,currentBreakpoint:n,breakpoint:a,width:c,icon:i,onClick:u})=>s.jsxRuntimeExports.jsxs(r.HoverCard,{children:[s.jsxRuntimeExports.jsx(r.HoverCardTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx(r.Button,{onClick:()=>u(c),size:"sm",variant:a===n?"secondary":"ghost",children:i})}),s.jsxRuntimeExports.jsx(r.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:e}),s.jsxRuntimeExports.jsx("p",{className:"text-xs",children:t})]})})})]}),nt=()=>{const[,e,t]=r.useCanvasWidth(),[n,a]=r.useSelectedBreakpoints(),c=i=>{n.includes(i)?n.length>2&&a(n.filter(u=>u!==i)):a(u=>[...u,i])};return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[x.map(ye.filter(i=>x.includes(n,x.toUpper(i.breakpoint))),i=>m.createElement(tt,{...i,onClick:t,key:i.breakpoint,currentBreakpoint:e})),s.jsxRuntimeExports.jsxs(r.DropdownMenu,{children:[s.jsxRuntimeExports.jsx(r.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(r.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[s.jsxRuntimeExports.jsx(r.DropdownMenuLabel,{children:"Breakpoints"}),s.jsxRuntimeExports.jsx(r.DropdownMenuSeparator,{}),x.map(ye,i=>s.jsxRuntimeExports.jsx(r.DropdownMenuCheckboxItem,{disabled:i.breakpoint==="xs",onCheckedChange:()=>c(x.toUpper(i.breakpoint)),checked:x.includes(n,x.toUpper(i.breakpoint)),children:i.title},i.breakpoint))]})]})]})},st=()=>{const[e]=r.useSetAllBlocks(),{createSnapshot:t}=r.useCanvasHistory(),[,n]=r.useSelectedBlockIds(),[,a]=r.useSelectedStylingBlocks(),c=m.useCallback(()=>{e([]),n([]),a([]),t()},[e,t]);return s.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:s.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[s.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsxs(r.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[s.jsxRuntimeExports.jsx(L.EraserIcon,{})," Clear"]})}),s.jsxRuntimeExports.jsxs(r.AlertDialogContent,{className:"border-border",children:[s.jsxRuntimeExports.jsxs(r.AlertDialogHeader,{children:[s.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:"Clear whole canvas?"}),s.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"Are you sure you want to clear the whole canvas?"})]}),s.jsxRuntimeExports.jsxs(r.AlertDialogFooter,{children:[s.jsxRuntimeExports.jsx(r.AlertDialogCancel,{children:"Cancel"}),s.jsxRuntimeExports.jsx(r.AlertDialogAction,{onClick:c,children:"Yes"})]})]})]})})},rt=()=>{const e=r.useFeatureSupport("darkMode",!1),[t]=r.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(et,{}),s.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"})]}):null,s.jsxRuntimeExports.jsx(nt,{}),s.jsxRuntimeExports.jsx(r.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:[x.round(t,0),"%"]})]}),s.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(Qe,{})]}),s.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[s.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(st,{})]})]})},ot=`<!doctype html>
|
|
4
4
|
<html class="scroll-smooth h-full overflow-y-auto">
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<div class="frame-root"></div>
|
|
48
48
|
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
49
49
|
</body>
|
|
50
|
-
</html>`,it=e=>{const[t]=r.useCanvasWidth(),[,n]=r.useCanvasZoom(),[a,c]=m.useState({}),i=m.useCallback(()=>{const{width:u,height:o}=e;if(u<t){const p=parseFloat((u/t).toString());let d={};o&&(d={height:
|
|
50
|
+
</html>`,it=e=>{const[t]=r.useCanvasWidth(),[,n]=r.useCanvasZoom(),[a,c]=m.useState({}),i=m.useCallback(()=>{const{width:u,height:o}=e;if(u<t){const p=parseFloat((u/t).toFixed(2).toString());let d={};const h=o*p;o&&(d={height:100+(o-h)/h*100+"%"}),c({position:"relative",top:0,transform:`scale(${p})`,transformOrigin:"top left",...d,maxWidth:"none"}),n(p*100)}else c({}),n(100)},[t,e,n]);return m.useEffect(()=>{i()},[t,e,n,i]),a};var te={exports:{}};/*
|
|
51
51
|
object-assign
|
|
52
52
|
(c) Sindre Sorhus
|
|
53
53
|
@license MIT
|
|
@@ -56,4 +56,4 @@ Valid keys: `+JSON.stringify(Object.keys(l),null," "));var M=N(b,T,y,S,v+"."+T,
|
|
|
56
56
|
outline: 1px solid ${n.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
|
|
57
57
|
}`)},[n,h]),m.useEffect(()=>{if(!u){w.textContent="";return}w.textContent=`[data-block-id="${u}"]{ pointer-events: none !important; opacity: 0.2 !important}`},[u]),m.useEffect(()=>{d&&(d.textContent=c?`[data-style-id="${c}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}`:"")},[c,n,d]),m.useEffect(()=>{g&&(g.textContent=`${x.map(i,({id:E})=>`[data-style-id="${E}"]`).join(",")}{
|
|
58
58
|
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
59
|
-
}`)},[i,g]),m.useEffect(()=>{const E=x.get(t,"bodyTextLightColor","#64748b"),A=x.get(t,"bodyTextDarkColor","#94a3b8"),D=x.get(t,"bodyBgLightColor","#FFFFFF"),q=x.get(t,"bodyBgDarkColor","#0f172a");o.body.className=`font-body antialiased text-[${E}] bg-[${D}] dark:text-[${A}] dark:bg-[${q}]`},[t,o,e]),e==="page"?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[I&&s.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${I.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),P&&I!==P&&s.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${P.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),I&&s.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${I}",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},At=e=>{const t={};return Object.keys(e).forEach(n=>{x.isString(e[n])&&e[n].startsWith(Z.SLOT_KEY)&&(t[n]=e[n].replace(Z.SLOT_KEY,"").split(","))}),t},Dt=x.memoize(e=>{const t=e.replace(Z.STYLES_KEY,"").split(",");return Ze.twMerge(t[0],t[1])});function Ot(e,t){return x.get(e,`${t}_attrs`,{})}function qt(e){const t={};return Object.keys(e).forEach(n=>{if(x.isString(e[n])&&e[n].startsWith(Z.STYLES_KEY)){const a=Dt(e[n]);t[n]={className:a,"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=x.get(e,"_bindings",{});return x.isEmpty(n)?{...e}:(x.each(n,(a,c)=>{x.isString(a)&&x.get(t,a,null)&&(e[c]=x.get(t,a,null))}),e)}function ue({blocks:e}){const t=r.useAllBlocks(),n=m.useCallback(i=>qt(i),[]),[a]=Q.useChaiExternalData(),[c]=r.useAtom(r.inlineEditingActiveAtom);return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:m.Children.toArray(e.map((i,u)=>{if(c===i._id)return null;const o=At(i),p={};x.isEmpty(o)||Object.keys(o).forEach(w=>{p[w]=m.Children.toArray(o[w].map(I=>s.jsxRuntimeExports.jsx(ue,{blocks:[x.find(t,{_id:I})]})))});const d=x.filter(t,{_parent:i._id});p.children=d.length?s.jsxRuntimeExports.jsx(ue,{blocks:d}):null;const h=Ge.getBlockComponent(i._type),g=x.get(h,"component",null);return x.isNull(g)?s.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${i==null?void 0:i._type} not registered -->`}):s.jsxRuntimeExports.jsx(m.Suspense,{children:m.createElement(g,{blockProps:{"data-block-id":i._id,"data-block-type":i._type,"data-dnd":r.canAddChildBlock(i._type)?"branch":"leaf"},inBuilder:!0,index:u,...Pt(i,a),...n(i),...p})})}))})}const Mt=()=>{const e=r.useAllBlocks();return s.jsxRuntimeExports.jsx(Ve.Provider,{children:x.isEmpty(e)?null:s.jsxRuntimeExports.jsx(Q.BlocksExternalDataProvider,{children:s.jsxRuntimeExports.jsx(ue,{blocks:x.filter(e,t=>x.isEmpty(t._parent))})})})},_t=(e,t)=>e.querySelector(`[data-style-id="${t}"]`),Lt=()=>{const[e]=H.useAtom(r.networkModeAtom),[t]=r.usePreviewMode(),[n]=r.useCanvasWidth(),[,a]=r.useSelectedBlockIds(),c=r.useSelectedBlock(),[,i]=r.useHighlightBlockId(),u=m.useRef(null),o=m.useRef(null),[p,d]=m.useState({width:0,height:0}),h=it(p),[g,w]=m.useState(0),[I,P]=m.useState([]),[,E]=m.useState([]),[,A]=H.useAtom(r.canvasIframeAtom),[D,q]=r.useSelectedStylingBlocks(),R=r.useBuilderProp("loadingCanvas",!1);m.useEffect(()=>{const{clientWidth:O,clientHeight:$}=o.current;d({width:O,height:$}),g===0&&w(O)},[o,n,g]);const F=(O,$=0)=>{const{top:U}=O.getBoundingClientRect();return U+$>=0&&U-$<=window.innerHeight};m.useEffect(()=>{var O,$;if(c&&c.type!=="Multiple"&&u.current){const U=qe(u.current.contentDocument,c._id);U&&(F(U)||($=(O=u.current)==null?void 0:O.contentWindow)==null||$.scrollTo({top:U.offsetTop,behavior:"smooth"}),P([U]))}},[c]),m.useEffect(()=>{if(!x.isEmpty(D)&&u.current){const O=_t(u.current.contentDocument,x.first(D).id);E(O?[O]:[null])}else E([null])},[D]);const W=m.useMemo(()=>{let O=ot;return e==="offline"&&(O=O.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),O=O.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),O=O.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),O},[e]);return s.jsxRuntimeExports.jsx("div",{onClick:()=>{a([]),q([])},onMouseLeave:()=>setTimeout(()=>i(""),300),className:"relative mx-auto overflow-hidden h-full w-full",style:g>0&&!x.isEmpty(h)?{width:t?"100%":g}:{},ref:o,children:s.jsxRuntimeExports.jsxs(ht,{contentDidMount:()=>A(u.current),ref:u,id:"canvas-iframe",style:{width:`${n}px`,...h},className:"relative mx-auto box-content
|
|
59
|
+
}`)},[i,g]),m.useEffect(()=>{const E=x.get(t,"bodyTextLightColor","#64748b"),A=x.get(t,"bodyTextDarkColor","#94a3b8"),D=x.get(t,"bodyBgLightColor","#FFFFFF"),q=x.get(t,"bodyBgDarkColor","#0f172a");o.body.className=`font-body antialiased text-[${E}] bg-[${D}] dark:text-[${A}] dark:bg-[${q}]`},[t,o,e]),e==="page"?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[I&&s.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${I.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),P&&I!==P&&s.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${P.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),I&&s.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${I}",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},At=e=>{const t={};return Object.keys(e).forEach(n=>{x.isString(e[n])&&e[n].startsWith(Z.SLOT_KEY)&&(t[n]=e[n].replace(Z.SLOT_KEY,"").split(","))}),t},Dt=x.memoize(e=>{const t=e.replace(Z.STYLES_KEY,"").split(",");return Ze.twMerge(t[0],t[1])});function Ot(e,t){return x.get(e,`${t}_attrs`,{})}function qt(e){const t={};return Object.keys(e).forEach(n=>{if(x.isString(e[n])&&e[n].startsWith(Z.STYLES_KEY)){const a=Dt(e[n]);t[n]={className:a,"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=x.get(e,"_bindings",{});return x.isEmpty(n)?{...e}:(x.each(n,(a,c)=>{x.isString(a)&&x.get(t,a,null)&&(e[c]=x.get(t,a,null))}),e)}function ue({blocks:e}){const t=r.useAllBlocks(),n=m.useCallback(i=>qt(i),[]),[a]=Q.useChaiExternalData(),[c]=r.useAtom(r.inlineEditingActiveAtom);return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:m.Children.toArray(e.map((i,u)=>{if(c===i._id)return null;const o=At(i),p={};x.isEmpty(o)||Object.keys(o).forEach(w=>{p[w]=m.Children.toArray(o[w].map(I=>s.jsxRuntimeExports.jsx(ue,{blocks:[x.find(t,{_id:I})]})))});const d=x.filter(t,{_parent:i._id});p.children=d.length?s.jsxRuntimeExports.jsx(ue,{blocks:d}):null;const h=Ge.getBlockComponent(i._type),g=x.get(h,"component",null);return x.isNull(g)?s.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${i==null?void 0:i._type} not registered -->`}):s.jsxRuntimeExports.jsx(m.Suspense,{children:m.createElement(g,{blockProps:{"data-block-id":i._id,"data-block-type":i._type,"data-dnd":r.canAddChildBlock(i._type)?"branch":"leaf"},inBuilder:!0,index:u,...Pt(i,a),...n(i),...p})})}))})}const Mt=()=>{const e=r.useAllBlocks();return s.jsxRuntimeExports.jsx(Ve.Provider,{children:x.isEmpty(e)?null:s.jsxRuntimeExports.jsx(Q.BlocksExternalDataProvider,{children:s.jsxRuntimeExports.jsx(ue,{blocks:x.filter(e,t=>x.isEmpty(t._parent))})})})},_t=(e,t)=>e.querySelector(`[data-style-id="${t}"]`),Lt=()=>{const[e]=H.useAtom(r.networkModeAtom),[t]=r.usePreviewMode(),[n]=r.useCanvasWidth(),[,a]=r.useSelectedBlockIds(),c=r.useSelectedBlock(),[,i]=r.useHighlightBlockId(),u=m.useRef(null),o=m.useRef(null),[p,d]=m.useState({width:0,height:0}),h=it(p),[g,w]=m.useState(0),[I,P]=m.useState([]),[,E]=m.useState([]),[,A]=H.useAtom(r.canvasIframeAtom),[D,q]=r.useSelectedStylingBlocks(),R=r.useBuilderProp("loadingCanvas",!1);m.useEffect(()=>{const{clientWidth:O,clientHeight:$}=o.current;d({width:O,height:$}),g===0&&w(O)},[o,n,g]);const F=(O,$=0)=>{const{top:U}=O.getBoundingClientRect();return U+$>=0&&U-$<=window.innerHeight};m.useEffect(()=>{var O,$;if(c&&c.type!=="Multiple"&&u.current){const U=qe(u.current.contentDocument,c._id);U&&(F(U)||($=(O=u.current)==null?void 0:O.contentWindow)==null||$.scrollTo({top:U.offsetTop,behavior:"smooth"}),P([U]))}},[c]),m.useEffect(()=>{if(!x.isEmpty(D)&&u.current){const O=_t(u.current.contentDocument,x.first(D).id);E(O?[O]:[null])}else E([null])},[D]);const W=m.useMemo(()=>{let O=ot;return e==="offline"&&(O=O.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),O=O.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),O=O.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),O},[e]);return s.jsxRuntimeExports.jsx("div",{onClick:()=>{a([]),q([])},onMouseLeave:()=>setTimeout(()=>i(""),300),className:"relative mx-auto overflow-hidden h-full w-full",style:g>0&&!x.isEmpty(h)?{width:t?"100%":g}:{},ref:o,children:s.jsxRuntimeExports.jsxs(ht,{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(Ct,{}),s.jsxRuntimeExports.jsx(It,{block:c,selectedBlockElement:x.first(I)}),s.jsxRuntimeExports.jsx(Bt,{model:"page"}),s.jsxRuntimeExports.jsx(St,{children:R?s.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:s.jsxRuntimeExports.jsx(r.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"})]})})},Nt=m.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-YS5XlqpG.cjs"))),Ft=()=>{const[e,t]=H.useAtom(r.addBlocksModalAtom);return s.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[s.jsxRuntimeExports.jsx(rt,{}),s.jsxRuntimeExports.jsxs("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(m.Suspense,{fallback:s.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-full"}),children:s.jsxRuntimeExports.jsx(Q.ErrorBoundary,{children:s.jsxRuntimeExports.jsx(Lt,{})})}),e?s.jsxRuntimeExports.jsx("div",{onClick:()=>t(!1),className:"absolute inset-0 z-50 flex items-center bg-black/30 backdrop-blur-sm",children:s.jsxRuntimeExports.jsx("div",{onClick:n=>n.stopPropagation(),className:"mx-auto h-[90%] w-[90%] max-w-3xl rounded-md bg-white p-4 shadow-lg shadow-black/10 xl:w-[65%]",children:s.jsxRuntimeExports.jsx(Nt,{})})}):null]})]})};exports.default=Ft;
|
|
@@ -4,21 +4,21 @@ var J = (e, t, n) => (bt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
|
4
4
|
import { j as r } from "./jsx-runtime-NV737rRe.js";
|
|
5
5
|
import X, { createElement as wt, useCallback as we, useState as U, useEffect as _, Component as Ue, Children as kt, Suspense as ze, useRef as De, useMemo as jt, lazy as Ct } from "react";
|
|
6
6
|
import { map as ie, includes as Be, toUpper as ue, round as Tt, throttle as Ye, noop as ee, isEmpty as K, first as ae, omit as St, pick as It, get as O, isString as ke, memoize as Et, each as Dt, find as Bt, filter as Ke, isNull as Ot } from "lodash";
|
|
7
|
-
import { ResetIcon as Oe, MobileIcon as Ae, LaptopIcon as At, DesktopIcon as Pt, DotsVerticalIcon as Rt, EraserIcon as Mt, ZoomInIcon as _t, DragHandleDots2Icon as Lt, ArrowUpIcon as Nt, CopyIcon as
|
|
7
|
+
import { ResetIcon as Oe, MobileIcon as Ae, LaptopIcon as At, DesktopIcon as Pt, DotsVerticalIcon as Rt, EraserIcon as Mt, ZoomInIcon as _t, DragHandleDots2Icon as Lt, ArrowUpIcon as Nt, CopyIcon as Ft, TrashIcon as $t } from "@radix-ui/react-icons";
|
|
8
8
|
import { p as je, B as le, W as Je, aI as Wt, aJ as Ht, aK as qt, aL as Ut, aM as zt, R as Ce, ai as Yt, aN as Kt, aO as Jt, aP as Xt, aQ as Vt, aR as Zt, aS as Gt, w as Qt, j as W, aj as V, D as en, E as tn, F as nn, G as rn, H as sn, I as on, J as an, K as ln, ap as cn, L as dn, U as Xe, aH as oe, aT as un, _ as G, ab as pn, aU as re, ae as Te, m as Ve, n as fn, k as hn, o as gn, h as Ze, l as Ge, ag as mn, aV as yn, aW as Qe, aX as vn, aY as xn, x as bn, a as wn, aZ as kn, a_ as jn, a6 as Cn, a$ as Tn, i as Sn, S as et, aw as In } from "./index-D15K4BZT.js";
|
|
9
9
|
import { useTranslation as En } from "react-i18next";
|
|
10
|
-
import { useAtom as
|
|
10
|
+
import { useAtom as F } from "jotai";
|
|
11
11
|
import Pe from "react-dom";
|
|
12
12
|
import { g as Dn, S as Re, a as tt } from "./MODIFIERS-MLfpKQY1.js";
|
|
13
|
-
import { r as nt, u as Bn, B as On, E as An } from "./index-
|
|
13
|
+
import { r as nt, u as Bn, B as On, E as An } from "./index-TP8jhZbU.js";
|
|
14
14
|
import { Quill as Pn } from "react-quill";
|
|
15
15
|
import { u as Rn } from "./useAddBlockByDrop-wiagwec5.js";
|
|
16
16
|
import { useFeature as rt } from "flagged";
|
|
17
17
|
import { flip as Mn } from "@floating-ui/dom";
|
|
18
18
|
import { useFloating as _n, shift as Ln } from "@floating-ui/react-dom";
|
|
19
19
|
import { useResizeObserver as Nn } from "@react-hookz/web";
|
|
20
|
-
import { tailwindcssPaletteGenerator as
|
|
21
|
-
import { Provider as
|
|
20
|
+
import { tailwindcssPaletteGenerator as Fn } from "@bobthered/tailwindcss-palette-generator";
|
|
21
|
+
import { Provider as $n } from "react-wrap-balancer";
|
|
22
22
|
import { twMerge as Wn } from "tailwind-merge";
|
|
23
23
|
import { getBlockComponent as Hn } from "@chaibuilder/runtime";
|
|
24
24
|
import "@radix-ui/react-toggle";
|
|
@@ -310,9 +310,15 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
310
310
|
const [t] = Ce(), [, n] = Xe(), [i, l] = U({}), o = we(() => {
|
|
311
311
|
const { width: d, height: s } = e;
|
|
312
312
|
if (d < t) {
|
|
313
|
-
const u = parseFloat((d / t).toString());
|
|
313
|
+
const u = parseFloat((d / t).toFixed(2).toString());
|
|
314
314
|
let c = {};
|
|
315
|
-
|
|
315
|
+
const f = s * u;
|
|
316
|
+
s && (c = {
|
|
317
|
+
// Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
|
|
318
|
+
height: 100 + (s - f) / f * 100 + "%"
|
|
319
|
+
}), l({
|
|
320
|
+
position: "relative",
|
|
321
|
+
top: 0,
|
|
316
322
|
transform: `scale(${u})`,
|
|
317
323
|
transformOrigin: "top left",
|
|
318
324
|
...c,
|
|
@@ -386,15 +392,15 @@ function Se() {
|
|
|
386
392
|
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
387
393
|
return fe = e, fe;
|
|
388
394
|
}
|
|
389
|
-
var he,
|
|
395
|
+
var he, Fe;
|
|
390
396
|
function st() {
|
|
391
|
-
return
|
|
397
|
+
return Fe || (Fe = 1, he = Function.call.bind(Object.prototype.hasOwnProperty)), he;
|
|
392
398
|
}
|
|
393
|
-
var ge,
|
|
399
|
+
var ge, $e;
|
|
394
400
|
function Gn() {
|
|
395
|
-
if (
|
|
401
|
+
if ($e)
|
|
396
402
|
return ge;
|
|
397
|
-
|
|
403
|
+
$e = 1;
|
|
398
404
|
var e = function() {
|
|
399
405
|
};
|
|
400
406
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -477,7 +483,7 @@ function Qn() {
|
|
|
477
483
|
any: A(),
|
|
478
484
|
arrayOf: k,
|
|
479
485
|
element: N(),
|
|
480
|
-
elementType:
|
|
486
|
+
elementType: $(),
|
|
481
487
|
instanceOf: B,
|
|
482
488
|
node: ft(),
|
|
483
489
|
objectOf: q,
|
|
@@ -562,7 +568,7 @@ function Qn() {
|
|
|
562
568
|
}
|
|
563
569
|
return E(a);
|
|
564
570
|
}
|
|
565
|
-
function
|
|
571
|
+
function $() {
|
|
566
572
|
function a(p, b, y, g, j) {
|
|
567
573
|
var m = p[b];
|
|
568
574
|
if (!e.isValidElementType(m)) {
|
|
@@ -822,7 +828,7 @@ const M = /* @__PURE__ */ Dn(rr);
|
|
|
822
828
|
let ot, it;
|
|
823
829
|
typeof document < "u" && (ot = document);
|
|
824
830
|
typeof window < "u" && (it = window);
|
|
825
|
-
const at = X.createContext({ document: ot, window: it }), de = () => X.useContext(at), { Provider: sr, Consumer:
|
|
831
|
+
const at = X.createContext({ document: ot, window: it }), de = () => X.useContext(at), { Provider: sr, Consumer: Fs } = at;
|
|
826
832
|
class lt extends Ue {
|
|
827
833
|
componentDidMount() {
|
|
828
834
|
this.props.contentDidMount();
|
|
@@ -968,7 +974,7 @@ function ve() {
|
|
|
968
974
|
e.style.display = "none";
|
|
969
975
|
}
|
|
970
976
|
const dr = () => {
|
|
971
|
-
const { document: e } = de(), [t, n] =
|
|
977
|
+
const { document: e } = de(), [t, n] = F(un), i = Rn(), l = rt("dnd"), [, o] = G(), [, d] = W();
|
|
972
978
|
return Y = e, {
|
|
973
979
|
isDragging: t,
|
|
974
980
|
"data-dnd": "branch",
|
|
@@ -1005,7 +1011,7 @@ function ur(e) {
|
|
|
1005
1011
|
t && t.parentNode.removeChild(t), e = null;
|
|
1006
1012
|
}
|
|
1007
1013
|
const pr = () => {
|
|
1008
|
-
const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = pn(), [, n] = W(), [, i] = G(), [l, o] =
|
|
1014
|
+
const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = pn(), [, n] = W(), [, i] = G(), [l, o] = F(re);
|
|
1009
1015
|
return (d) => {
|
|
1010
1016
|
var w;
|
|
1011
1017
|
if (l)
|
|
@@ -1025,7 +1031,7 @@ const pr = () => {
|
|
|
1025
1031
|
c.addEventListener("blur", h, !0), f.focus(), (w = c.querySelector(".ql-clipboard")) == null || w.remove(), n([]), o(s.getAttribute("data-block-id"));
|
|
1026
1032
|
};
|
|
1027
1033
|
}, fr = () => {
|
|
1028
|
-
const [, e] = V(), [, t] = W(), [n] =
|
|
1034
|
+
const [, e] = V(), [, t] = W(), [n] = F(re);
|
|
1029
1035
|
return (i) => {
|
|
1030
1036
|
if (n)
|
|
1031
1037
|
return;
|
|
@@ -1041,7 +1047,7 @@ const pr = () => {
|
|
|
1041
1047
|
const n = Ie(e.target);
|
|
1042
1048
|
n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
|
|
1043
1049
|
}, 100), gr = () => {
|
|
1044
|
-
const [, e] = G(), [t] =
|
|
1050
|
+
const [, e] = G(), [t] = F(re);
|
|
1045
1051
|
return (n) => {
|
|
1046
1052
|
t || hr(n, e);
|
|
1047
1053
|
};
|
|
@@ -1075,7 +1081,7 @@ const pr = () => {
|
|
|
1075
1081
|
}
|
|
1076
1082
|
);
|
|
1077
1083
|
}, ut = (e, t) => e.querySelector(`[data-block-id="${t}"]`), yr = () => {
|
|
1078
|
-
const { window: e } = de(), [t, n] = W(), i = Te(), [, l] = V(), { undo: o, redo: d } = je(), s = Ve(), [, u] = fn(), [, c] = hn(), { pasteBlocks: f } = gn(), [, h] = Ze(), w = Ge(), { savePage: S } = mn(), [P] =
|
|
1084
|
+
const { window: e } = de(), [t, n] = W(), i = Te(), [, l] = V(), { undo: o, redo: d } = je(), s = Ve(), [, u] = fn(), [, c] = hn(), { pasteBlocks: f } = gn(), [, h] = Ze(), w = Ge(), { savePage: S } = mn(), [P] = F(re), [, x] = F(yn), E = (A) => {
|
|
1079
1085
|
A.key === "Enter" && (A.preventDefault(), t.length === 1 && x(ae(t)));
|
|
1080
1086
|
}, D = (A) => {
|
|
1081
1087
|
const k = i.find((N) => N._id === A);
|
|
@@ -1120,7 +1126,7 @@ const pr = () => {
|
|
|
1120
1126
|
e
|
|
1121
1127
|
]), null;
|
|
1122
1128
|
}, vr = ({ block: e, label: t }) => {
|
|
1123
|
-
const [, n] = W(), [, i] = G(), [, l] =
|
|
1129
|
+
const [, n] = W(), [, i] = G(), [, l] = F(Qe), o = rt("dnd");
|
|
1124
1130
|
return /* @__PURE__ */ r.jsxs(
|
|
1125
1131
|
"div",
|
|
1126
1132
|
{
|
|
@@ -1171,14 +1177,14 @@ const pr = () => {
|
|
|
1171
1177
|
}
|
|
1172
1178
|
}
|
|
1173
1179
|
),
|
|
1174
|
-
vn(O(t, "_type", "")) ? /* @__PURE__ */ r.jsx(
|
|
1175
|
-
xn(O(t, "_type", "")) ? /* @__PURE__ */ r.jsx(
|
|
1180
|
+
vn(O(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Ft, { className: "hover:scale-105 ", onClick: () => i([t == null ? void 0 : t._id]) }) : null,
|
|
1181
|
+
xn(O(t, "_type", "")) ? /* @__PURE__ */ r.jsx($t, { className: "hover:scale-105 ", onClick: () => n([t == null ? void 0 : t._id]) }) : null
|
|
1176
1182
|
] })
|
|
1177
1183
|
]
|
|
1178
1184
|
}
|
|
1179
1185
|
);
|
|
1180
1186
|
}, br = ({ model: e }) => {
|
|
1181
|
-
const [t] = bn(), [n] = W(), [i] = Je(), [l] = G(), [o] = V(), [d] =
|
|
1187
|
+
const [t] = bn(), [n] = W(), [i] = Je(), [l] = G(), [o] = V(), [d] = F(Qe), { document: s, window: u } = de(), [c] = U(s == null ? void 0 : s.getElementById("highlighted-block")), [f] = U(
|
|
1182
1188
|
s == null ? void 0 : s.getElementById("selected-block")
|
|
1183
1189
|
), [h] = U(
|
|
1184
1190
|
s == null ? void 0 : s.getElementById("selected-styling-block")
|
|
@@ -1188,7 +1194,7 @@ const pr = () => {
|
|
|
1188
1194
|
}, [i, s]);
|
|
1189
1195
|
const S = O(t, "headingFont", "DM Sans"), P = O(t, "bodyFont", "DM Sans");
|
|
1190
1196
|
return _(() => {
|
|
1191
|
-
const x = O(t, "primaryColor", "#000"), E = O(t, "secondaryColor", "#FFF"), D =
|
|
1197
|
+
const x = O(t, "primaryColor", "#000"), E = O(t, "secondaryColor", "#FFF"), D = Fn({
|
|
1192
1198
|
colors: [x, E],
|
|
1193
1199
|
names: ["primary", "secondary"]
|
|
1194
1200
|
});
|
|
@@ -1211,13 +1217,13 @@ const pr = () => {
|
|
|
1211
1217
|
plugins: [
|
|
1212
1218
|
// @ts-ignore
|
|
1213
1219
|
u.tailwind.plugin.withOptions(({ prefix: k = "ui" } = {}) => ({ addVariant: N }) => {
|
|
1214
|
-
for (const
|
|
1215
|
-
N(`${k}-${
|
|
1216
|
-
`&[data-headlessui-state~="${
|
|
1217
|
-
`:where([data-headlessui-state~="${
|
|
1218
|
-
]), N(`${k}-not-${
|
|
1219
|
-
`&[data-headlessui-state]:not([data-headlessui-state~="${
|
|
1220
|
-
`:where([data-headlessui-state]:not([data-headlessui-state~="${
|
|
1220
|
+
for (const $ of ["open", "checked", "selected", "active", "disabled"])
|
|
1221
|
+
N(`${k}-${$}`, [
|
|
1222
|
+
`&[data-headlessui-state~="${$}"]`,
|
|
1223
|
+
`:where([data-headlessui-state~="${$}"]) &`
|
|
1224
|
+
]), N(`${k}-not-${$}`, [
|
|
1225
|
+
`&[data-headlessui-state]:not([data-headlessui-state~="${$}"])`,
|
|
1226
|
+
`:where([data-headlessui-state]:not([data-headlessui-state~="${$}"])) &:not([data-headlessui-state])`
|
|
1221
1227
|
]);
|
|
1222
1228
|
})
|
|
1223
1229
|
]
|
|
@@ -1335,9 +1341,9 @@ function be({ blocks: e }) {
|
|
|
1335
1341
|
}
|
|
1336
1342
|
const Sr = () => {
|
|
1337
1343
|
const e = Te();
|
|
1338
|
-
return /* @__PURE__ */ r.jsx(
|
|
1344
|
+
return /* @__PURE__ */ r.jsx($n, { children: K(e) ? null : /* @__PURE__ */ r.jsx(On, { children: /* @__PURE__ */ r.jsx(be, { blocks: Ke(e, (t) => K(t._parent)) }) }) });
|
|
1339
1345
|
}, Ir = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Er = () => {
|
|
1340
|
-
const [e] =
|
|
1346
|
+
const [e] = F(jn), [t] = Ze(), [n] = Ce(), [, i] = W(), l = Cn(), [, o] = G(), d = De(null), s = De(null), [u, c] = U({ width: 0, height: 0 }), f = Vn(u), [h, w] = U(0), [S, P] = U([]), [, x] = U([]), [, E] = F(Tn), [D, A] = V(), k = Sn("loadingCanvas", !1);
|
|
1341
1347
|
_(() => {
|
|
1342
1348
|
const { clientWidth: B, clientHeight: H } = s.current;
|
|
1343
1349
|
c({ width: B, height: H }), h === 0 && w(B);
|
|
@@ -1362,7 +1368,7 @@ const Sr = () => {
|
|
|
1362
1368
|
} else
|
|
1363
1369
|
x([null]);
|
|
1364
1370
|
}, [D]);
|
|
1365
|
-
const
|
|
1371
|
+
const $ = jt(() => {
|
|
1366
1372
|
let B = Xn;
|
|
1367
1373
|
return e === "offline" && (B = B.replace(
|
|
1368
1374
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
@@ -1386,8 +1392,8 @@ const Sr = () => {
|
|
|
1386
1392
|
ref: d,
|
|
1387
1393
|
id: "canvas-iframe",
|
|
1388
1394
|
style: { width: `${n}px`, ...f },
|
|
1389
|
-
className: "relative mx-auto box-content
|
|
1390
|
-
initialContent:
|
|
1395
|
+
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
1396
|
+
initialContent: $,
|
|
1391
1397
|
children: [
|
|
1392
1398
|
/* @__PURE__ */ r.jsx(yr, {}),
|
|
1393
1399
|
/* @__PURE__ */ r.jsx(
|
|
@@ -1406,8 +1412,8 @@ const Sr = () => {
|
|
|
1406
1412
|
)
|
|
1407
1413
|
}
|
|
1408
1414
|
);
|
|
1409
|
-
}, Dr = Ct(() => import("./AddBlocks-Rd2EpNMr.js")),
|
|
1410
|
-
const [e, t] =
|
|
1415
|
+
}, Dr = Ct(() => import("./AddBlocks-Rd2EpNMr.js")), $s = () => {
|
|
1416
|
+
const [e, t] = F(In);
|
|
1411
1417
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1412
1418
|
/* @__PURE__ */ r.jsx(Jn, {}),
|
|
1413
1419
|
/* @__PURE__ */ r.jsxs("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: [
|
|
@@ -1431,5 +1437,5 @@ const Sr = () => {
|
|
|
1431
1437
|
] });
|
|
1432
1438
|
};
|
|
1433
1439
|
export {
|
|
1434
|
-
|
|
1440
|
+
$s as default
|
|
1435
1441
|
};
|
|
@@ -3,7 +3,7 @@ import { ag as x, aq as h, ar as f, as as j, at as y, au as P } from "./index-D1
|
|
|
3
3
|
import { sortBy as v, filter as b, get as w, isEmpty as s, find as n, capitalize as C, map as N } from "lodash";
|
|
4
4
|
import { toast as S } from "sonner";
|
|
5
5
|
import { useEffect as p } from "react";
|
|
6
|
-
import { b as k, a as B, d as E, e as I } from "./index-
|
|
6
|
+
import { b as k, a as B, d as E, e as I } from "./index-TP8jhZbU.js";
|
|
7
7
|
import { BriefcaseIcon as L } from "lucide-react";
|
|
8
8
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),s=require("./index-MIe2pKhn.cjs"),i=require("lodash"),h=require("sonner"),l=require("react"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),s=require("./index-MIe2pKhn.cjs"),i=require("lodash"),h=require("sonner"),l=require("react"),o=require("./index-OgEmBQj6.cjs"),j=require("lucide-react");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.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("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("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");const p=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:q}=s.useSavePage(),d=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,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(t.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(s.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(s.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(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
|
@@ -10,7 +10,7 @@ import "./lib.js";
|
|
|
10
10
|
import { useMemo as $e, lazy as Ke, useCallback as Qe, useState as Ue, Suspense as Ye } from "react";
|
|
11
11
|
import { a as qe } from "./MODIFIERS-MLfpKQY1.js";
|
|
12
12
|
import { c as S } from "./utils-PPBbw5bk.js";
|
|
13
|
-
import { f as We } from "./index-
|
|
13
|
+
import { f as We } from "./index-TP8jhZbU.js";
|
|
14
14
|
import { useAtom as Ze } from "jotai";
|
|
15
15
|
import { u as Je } from "./useAddBlockByDrop-wiagwec5.js";
|
|
16
16
|
import "@radix-ui/react-toggle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("lodash"),t=require("@radix-ui/react-icons"),f=require("react-dnd"),B=require("@minoru/react-dnd-treeview"),N=require("react-i18next"),r=require("./index-MIe2pKhn.cjs"),O=require("lucide-react");require("./lib.cjs");const R=require("react"),A=require("./MODIFIERS-WFzDQfiT.cjs"),y=require("./utils-It2K33fU.cjs"),_=require("./index-kVugkp77.cjs"),P=require("jotai"),H=require("./useAddBlockByDrop-8i3iNtPF.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("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("clsx");require("tailwind-merge");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");const C=s=>{switch(s.type){case"Image":return e.jsxRuntimeExports.jsx(t.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(t.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(t.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(t.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(t.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(t.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(t.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(t.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(t.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(t.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(t.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(t.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(t.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(t.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(t.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(t.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(t.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(t.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(t.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(t.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(t.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(t.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(t.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(t.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(t.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(t.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(O.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(t.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(t.BoxModelIcon,{})}};function L(s=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(s))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(s))return"Visible on mobile";if(s.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=s.match(c);if(u.nth(l,1))return`Visible >=${n[u.nth(l,1)]}`}return""}const F=s=>{let n="";return Object.keys(s).forEach(o=>{u.startsWith(s[o],A.STYLES_KEY)&&(n=s[o])}),n},V=s=>{var j;const[,n]=r.useHighlightBlockId(),[o]=r.useHiddenBlockIds(),{isSelected:i}=s,{id:c,data:l}=s.node,d=s.depth*10,m=a=>{a.stopPropagation(),s.onToggle(s.node.id)},E=B.useDragOver(c,s.isOpen,s.onToggle),p=R.useMemo(()=>{const a=F(s.node.data);return L(a)},[s.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:y.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)&&s.onSelect(c)},onContextMenu:()=>s.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 ${s.isOpen?"rotate-90":""}`,children:s.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:m,type:"button",children:e.jsxRuntimeExports.jsx(t.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:((j=s.node.data)==null?void 0:j._name)||s.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(i?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},z=s=>{var o;const{item:n}=s.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})]})},G=s=>{const n=s.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}})},$=R.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-GV1kflbN.cjs"))),K=()=>{const[s]=r.useSelectedBlockIds(),[,n]=r.useCutBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(s),children:[e.jsxRuntimeExports.jsx(t.ScissorsIcon,{})," Cut"]})},Q=()=>{const[s]=r.useSelectedBlockIds(),[,n]=r.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(s),children:[e.jsxRuntimeExports.jsx(t.ClipboardIcon,{})," Copy"]})},U=()=>{const[s]=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(s),children:[e.jsxRuntimeExports.jsx(t.TrashIcon,{})," Remove"]})},Y=({id:s=null,openMarkAsGlobalModal:n})=>{const[o]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=r.usePasteBlocks(),d=r.useBuilderProp("globalBlocksSupport",!1),m=R.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(t.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:m,children:[e.jsxRuntimeExports.jsx(t.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(K,{}),e.jsxRuntimeExports.jsx(Q,{}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(s),disabled:!l,children:[e.jsxRuntimeExports.jsx(t.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(U,{})]})},W=({children:s,id:n=null})=>{const[o,i]=R.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(R.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx($,{closeModal:()=>i(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:s}),e.jsxRuntimeExports.jsx(Y,{id:n,openMarkAsGlobalModal:()=>i(!0)})]})]})};function J(s){return u.map(s,n=>{const{data:o}=n;return{...o,_parent:n.parent===0?null:n.parent}})}const X=()=>{const s=r.useAllBlocks(),[n]=r.useSetAllBlocks(),[o,i,c]=r.useSelectedBlockIds(),[,l]=r.useSelectedStylingBlocks(),{t:d}=N.useTranslation(),{createSnapshot:m}=r.useCanvasHistory(),E=_.useExpandedIds(),p=H.useAddBlockByDrop(),[,j]=P.useAtom(r.addBlocksModalAtom),a=async(x,g)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:q}=g;if(h){m();const T=J(x);n(T);const M=q.getItem();i([M.id])}else await p({block:q.getItem(),dropTargetId:k,relativeIndex:b}),j(!1)},v=u.map(s,x=>({id:x._id,text:x._type,parent:x._parent||0,droppable:!u.isUndefined(u.find(s,{_parent:x._id})),data:x})),S=()=>{i([]),l([])},[{isOver:I},w]=f.useDrop(()=>({accept:["CHAI_BLOCK"],collect:x=>({canDrop:x.canDrop(),isOver:x.isOver()}),drop:x=>{(async()=>(await p({block:x,dropTargetId:"",relativeIndex:0}),j(!1)))()}})),{isDragging:D}=f.useDragLayer(x=>({isDragging:x.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>S(),className:y.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",D?"bg-green-50/80":"bg-background"),children:u.isEmpty(s)?e.jsxRuntimeExports.jsxs("div",{ref:w,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(t.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(t.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(B.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:v,rootId:0,render:(x,{depth:g,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(W,{id:x.id,children:e.jsxRuntimeExports.jsx(V,{onSelect:k=>{l([]),i([k])},isSelected:u.includes(o,x.id),node:x,depth:g,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:x=>e.jsxRuntimeExports.jsx(z,{monitorProps:x}),onDrop:a,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:g})=>e.jsxRuntimeExports.jsx(G,{node:x,depth:g})})})})})};exports.default=X;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("lodash"),t=require("@radix-ui/react-icons"),f=require("react-dnd"),B=require("@minoru/react-dnd-treeview"),N=require("react-i18next"),r=require("./index-MIe2pKhn.cjs"),O=require("lucide-react");require("./lib.cjs");const R=require("react"),A=require("./MODIFIERS-WFzDQfiT.cjs"),y=require("./utils-It2K33fU.cjs"),_=require("./index-OgEmBQj6.cjs"),P=require("jotai"),H=require("./useAddBlockByDrop-8i3iNtPF.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("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("clsx");require("tailwind-merge");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");const C=s=>{switch(s.type){case"Image":return e.jsxRuntimeExports.jsx(t.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(t.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(t.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(t.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(t.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(t.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(t.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(t.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(t.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(t.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(t.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(t.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(t.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(t.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(t.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(t.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(t.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(t.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(t.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(t.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(t.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(t.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(t.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(t.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(t.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(t.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(O.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(t.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(t.BoxModelIcon,{})}};function L(s=""){const n={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(s))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(s))return"Visible on mobile";if(s.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=s.match(c);if(u.nth(l,1))return`Visible >=${n[u.nth(l,1)]}`}return""}const F=s=>{let n="";return Object.keys(s).forEach(o=>{u.startsWith(s[o],A.STYLES_KEY)&&(n=s[o])}),n},V=s=>{var j;const[,n]=r.useHighlightBlockId(),[o]=r.useHiddenBlockIds(),{isSelected:i}=s,{id:c,data:l}=s.node,d=s.depth*10,m=a=>{a.stopPropagation(),s.onToggle(s.node.id)},E=B.useDragOver(c,s.isOpen,s.onToggle),p=R.useMemo(()=>{const a=F(s.node.data);return L(a)},[s.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>n(c),className:y.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)&&s.onSelect(c)},onContextMenu:()=>s.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 ${s.isOpen?"rotate-90":""}`,children:s.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:m,type:"button",children:e.jsxRuntimeExports.jsx(t.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:((j=s.node.data)==null?void 0:j._name)||s.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(i?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},z=s=>{var o;const{item:n}=s.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})]})},G=s=>{const n=s.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}})},$=R.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-GV1kflbN.cjs"))),K=()=>{const[s]=r.useSelectedBlockIds(),[,n]=r.useCutBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(s),children:[e.jsxRuntimeExports.jsx(t.ScissorsIcon,{})," Cut"]})},Q=()=>{const[s]=r.useSelectedBlockIds(),[,n]=r.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>n(s),children:[e.jsxRuntimeExports.jsx(t.ClipboardIcon,{})," Copy"]})},U=()=>{const[s]=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(s),children:[e.jsxRuntimeExports.jsx(t.TrashIcon,{})," Remove"]})},Y=({id:s=null,openMarkAsGlobalModal:n})=>{const[o]=r.useSelectedBlockIds(),i=r.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=r.usePasteBlocks(),d=r.useBuilderProp("globalBlocksSupport",!1),m=R.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(t.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:m,children:[e.jsxRuntimeExports.jsx(t.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(K,{}),e.jsxRuntimeExports.jsx(Q,{}),e.jsxRuntimeExports.jsxs(r.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(s),disabled:!l,children:[e.jsxRuntimeExports.jsx(t.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(U,{})]})},W=({children:s,id:n=null})=>{const[o,i]=R.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(R.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx($,{closeModal:()=>i(!1),id:n})})})}),e.jsxRuntimeExports.jsxs(r.ContextMenu,{children:[e.jsxRuntimeExports.jsx(r.ContextMenuTrigger,{children:s}),e.jsxRuntimeExports.jsx(Y,{id:n,openMarkAsGlobalModal:()=>i(!0)})]})]})};function J(s){return u.map(s,n=>{const{data:o}=n;return{...o,_parent:n.parent===0?null:n.parent}})}const X=()=>{const s=r.useAllBlocks(),[n]=r.useSetAllBlocks(),[o,i,c]=r.useSelectedBlockIds(),[,l]=r.useSelectedStylingBlocks(),{t:d}=N.useTranslation(),{createSnapshot:m}=r.useCanvasHistory(),E=_.useExpandedIds(),p=H.useAddBlockByDrop(),[,j]=P.useAtom(r.addBlocksModalAtom),a=async(x,g)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:q}=g;if(h){m();const T=J(x);n(T);const M=q.getItem();i([M.id])}else await p({block:q.getItem(),dropTargetId:k,relativeIndex:b}),j(!1)},v=u.map(s,x=>({id:x._id,text:x._type,parent:x._parent||0,droppable:!u.isUndefined(u.find(s,{_parent:x._id})),data:x})),S=()=>{i([]),l([])},[{isOver:I},w]=f.useDrop(()=>({accept:["CHAI_BLOCK"],collect:x=>({canDrop:x.canDrop(),isOver:x.isOver()}),drop:x=>{(async()=>(await p({block:x,dropTargetId:"",relativeIndex:0}),j(!1)))()}})),{isDragging:D}=f.useDragLayer(x=>({isDragging:x.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>S(),className:y.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",D?"bg-green-50/80":"bg-background"),children:u.isEmpty(s)?e.jsxRuntimeExports.jsxs("div",{ref:w,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(t.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(t.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(B.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:v,rootId:0,render:(x,{depth:g,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(W,{id:x.id,children:e.jsxRuntimeExports.jsx(V,{onSelect:k=>{l([]),i([k])},isSelected:u.includes(o,x.id),node:x,depth:g,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:x=>e.jsxRuntimeExports.jsx(z,{monitorProps:x}),onDrop:a,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:g})=>e.jsxRuntimeExports.jsx(G,{node:x,depth:g})})})})})};exports.default=X;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("react"),i=require("lodash"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),u=require("react"),i=require("lodash"),s=require("./index-OgEmBQj6.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("i18next");require("react-i18next");require("./index-MIe2pKhn.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.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("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("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-HyQBukId.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-3X3bD4I6.cjs"))),d=()=>{const{data:q=[],isLoading:t}=s.usePages(),{data:r}=s.useProject(),n=i.sortBy(i.filter(q,{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:t,pages:n})})]})};exports.default=d;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-NV737rRe.js";
|
|
2
2
|
import i, { Suspense as s } from "react";
|
|
3
3
|
import { sortBy as a, filter as d, get as n } from "lodash";
|
|
4
|
-
import { a as l, b as c } from "./index-
|
|
4
|
+
import { a as l, b as c } from "./index-TP8jhZbU.js";
|
|
5
5
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
6
6
|
import "i18next";
|
|
7
7
|
import "react-i18next";
|
|
@@ -56,7 +56,7 @@ import "./tailwind-config-d1VL1lzE.js";
|
|
|
56
56
|
import "react-hotkeys-hook";
|
|
57
57
|
import "sonner";
|
|
58
58
|
import "lucide-react";
|
|
59
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
59
|
+
const x = i.lazy(() => import("./add-page-modal-God3usfm.js")), g = i.lazy(() => import("./page-viewer-xv8TBR-B.js")), bt = () => {
|
|
60
60
|
const { data: o = [], isLoading: m } = l(), { data: r } = c(), p = a(d(o, { type: "STATIC" }), (e) => n(e, "uuid") === (r == null ? void 0 : r.homepage) ? 0 : 1);
|
|
61
61
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
62
62
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("react"),x=require("lodash"),s=require("./index-MIe2pKhn.cjs"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("react"),x=require("lodash"),s=require("./index-MIe2pKhn.cjs"),a=require("./index-OgEmBQj6.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.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("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("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-IJFP4L0Q.cjs"))),q=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-uEYqfVt6.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;
|
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-NV737rRe.js";
|
|
|
2
2
|
import m, { useRef as x, useEffect as a, Suspense as p } from "react";
|
|
3
3
|
import { isEqual as b, isEmpty as j } from "lodash";
|
|
4
4
|
import { bh as h, bi as n, bj as l, bk as c } from "./index-D15K4BZT.js";
|
|
5
|
-
import { c as f, b as g } from "./index-
|
|
5
|
+
import { c as f, b as g } from "./index-TP8jhZbU.js";
|
|
6
6
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
7
7
|
import "@radix-ui/react-toggle";
|
|
8
8
|
import "class-variance-authority";
|
|
@@ -56,7 +56,7 @@ import "./tailwind-config-d1VL1lzE.js";
|
|
|
56
56
|
import "react-hotkeys-hook";
|
|
57
57
|
import "sonner";
|
|
58
58
|
import "lucide-react";
|
|
59
|
-
const N = m.lazy(() => import("./project-general-setting-
|
|
59
|
+
const N = m.lazy(() => import("./project-general-setting-AIICdB3T.js")), S = m.lazy(() => import("./project-seo-setting-bW4cNODi.js")), d = /* @__PURE__ */ t.jsx("div", { className: "px-3", children: /* @__PURE__ */ t.jsx("div", { className: "h-52 w-full animate-pulse rounded-md bg-gray-100" }) }), u = (r) => r && j(r.seoData) ? {
|
|
60
60
|
...r,
|
|
61
61
|
seoData: { title: "", description: "", image: "" }
|
|
62
62
|
} : r;
|