@chaibuilder/sdk 1.2.14 → 1.2.15
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-zN5--UP6.js → AddBlocks-IE14csoo.js} +63 -57
- package/dist/{AddBlocks-tomDo_Is.cjs → AddBlocks-OpGQyVQZ.cjs} +1 -1
- package/dist/{BrandingOptions-BUmE4f72.cjs → BrandingOptions-tBWzqas5.cjs} +1 -1
- package/dist/{BrandingOptions-LbizrmRI.js → BrandingOptions-t_MjeHSM.js} +1 -1
- package/dist/{CanvasArea-1PwexKQz.cjs → CanvasArea-SBeW-Kdq.cjs} +4 -4
- package/dist/{CanvasArea-leUzGAdQ.js → CanvasArea-TR5t1xxh.js} +3 -3
- package/dist/{CurrentPage-M6uJPKhj.cjs → CurrentPage--ag-4O2R.cjs} +1 -1
- package/dist/{CurrentPage-XSq62fdk.js → CurrentPage-JUlhyVbI.js} +2 -2
- package/dist/{Layers-tasAbEc8.cjs → Layers-05Ut4xZA.cjs} +1 -1
- package/dist/{Layers-JoV3wull.js → Layers-Dav1kBNN.js} +125 -148
- package/dist/{PagesPanel-5KjlPTtj.js → PagesPanel--feFCDeH.js} +3 -3
- package/dist/{PagesPanel-v1B780fd.cjs → PagesPanel-TLVCJtcF.cjs} +1 -1
- package/dist/{ProjectPanel-4X2KLnOi.js → ProjectPanel--Vq6HSMl.js} +3 -3
- package/dist/{ProjectPanel-NZYWWYTt.cjs → ProjectPanel-Q8sNFs1f.cjs} +1 -1
- package/dist/{Settings-FW-bX28i.cjs → Settings-9iryF0yE.cjs} +1 -1
- package/dist/{Settings-1WP3BWxr.js → Settings-DjE6HR2E.js} +2 -2
- package/dist/{SidePanels-ZlDXRldT.js → SidePanels-4zpCzCM6.js} +68 -68
- package/dist/{SidePanels-YpyBLRub.cjs → SidePanels-LVED6uuT.cjs} +1 -1
- package/dist/{Topbar-2sOsQD2d.cjs → Topbar-iH2L4pe0.cjs} +1 -1
- package/dist/{Topbar-xvrno03z.js → Topbar-ryFhl-PC.js} +1 -1
- package/dist/{UnsplashImages-EiYSWkBa.cjs → UnsplashImages-SrxA-yNu.cjs} +1 -1
- package/dist/{UnsplashImages-hhPOf7kt.js → UnsplashImages-ppQXZ28F.js} +1 -1
- package/dist/{UploadImages-JKjE44i7.js → UploadImages-IKR4oX2k.js} +1 -1
- package/dist/{UploadImages-GGCExfQd.cjs → UploadImages-VBiO6lqp.cjs} +1 -1
- package/dist/{add-page-modal-ueEpfep_.cjs → add-page-modal-KixvLXAG.cjs} +1 -1
- package/dist/{add-page-modal-iYgzDs08.js → add-page-modal-nZJaunuz.js} +3 -3
- package/dist/{confirm-alert-Nw1JCtuu.js → confirm-alert-QKtbNbWz.js} +1 -1
- package/dist/{confirm-alert-_DCO6hCV.cjs → confirm-alert-uV_PtYc3.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/{delete-page-modal-CT-ZA6H5.cjs → delete-page-modal-6GxLQkEk.cjs} +1 -1
- package/dist/{delete-page-modal-hlR-A69E.js → delete-page-modal-pN5cFz-m.js} +2 -2
- package/dist/email.cjs +1 -1
- package/dist/email.js +2 -2
- package/dist/{form-vNgf0kO2.cjs → form-KkP1F7h1.cjs} +1 -1
- package/dist/{form-lbFCPUoE.js → form-faX0Yn4Q.js} +1 -1
- package/dist/{index-bfKqnRvZ.cjs → index-ERorPL9q.cjs} +1 -1
- package/dist/{index-m9VziIOy.js → index-QGA4ayU7.js} +275 -275
- package/dist/{index-DXznIJrr.js → index-nrRnwUaC.js} +3 -3
- package/dist/{index-TBa4RPnS.cjs → index-xJ8LmB04.cjs} +2 -2
- package/dist/{page-viewer-voX6SLpK.cjs → page-viewer-Nn__90Uo.cjs} +1 -1
- package/dist/{page-viewer-Hgr72mrQ.js → page-viewer-U7o88VvR.js} +3 -3
- package/dist/{project-general-setting-VFFXhGpN.cjs → project-general-setting-C98_GooL.cjs} +1 -1
- package/dist/{project-general-setting-OdZj-lfx.js → project-general-setting-h0TeKYRf.js} +3 -3
- package/dist/{project-seo-setting-aRDdqu88.cjs → project-seo-setting-8oJUrOqk.cjs} +1 -1
- package/dist/{project-seo-setting-9V67NFil.js → project-seo-setting-Sl6AE-Q7.js} +2 -2
- package/dist/{single-page-detail-FIwXvGx2.cjs → single-page-detail-RYI1ukX6.cjs} +1 -1
- package/dist/{single-page-detail-AjhWBVK1.js → single-page-detail-a8zY-XHs.js} +4 -4
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useAddBlockByDrop-1WvPoBXa.cjs → useAddBlockByDrop-LBgi6GL7.cjs} +1 -1
- package/dist/{useAddBlockByDrop-bs_SH7Tw.js → useAddBlockByDrop-Y-g4O8UC.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-ERorPL9q.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-xJ8LmB04.cjs"),j=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const p=()=>{const{data:s}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:d}=t.useSavePage(),q=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&s.homepage&&!i.find(u,{uuid:n})&&a(s.homepage)},[n,u,s,a]),l.useEffect(()=>()=>a(null),[a]);const m=r=>{if(d!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});q(g)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),i.capitalize(s.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(t.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(t.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { a9 as x, aj as h, ak as f, al as j, am as y, an as P } from "./index-
|
|
2
|
+
import { a9 as x, aj as h, ak as f, al as j, am as y, an as P } from "./index-QGA4ayU7.js";
|
|
3
3
|
import { sortBy as v, filter as b, get as k, isEmpty as m, find as n, capitalize as w, map as C } from "lodash-es";
|
|
4
4
|
import { toast as N } from "sonner";
|
|
5
5
|
import { useEffect as p } from "react";
|
|
6
|
-
import { b as S, a as B, d as E, e as I } from "./index-
|
|
6
|
+
import { b as S, a as B, d as E, e as I } from "./index-nrRnwUaC.js";
|
|
7
7
|
import { BriefcaseIcon as L } from "lucide-react";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),B=require("@minoru/react-dnd-treeview"),O=require("react-i18next"),n=require("./index-bfKqnRvZ.cjs"),N=require("lucide-react"),f=require("react"),M=require("./MODIFIERS-2FeVfZQ9.cjs"),q=require("./Functions-N3yhPYKY.cjs"),_=require("./index-TBa4RPnS.cjs"),A=require("./useAddBlockByDrop-1WvPoBXa.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const v=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(N.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function H(t=""){const r={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const u=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),a=t.match(u);if(x.nth(a,1))return`Visible >=${r[x.nth(a,1)]}`}return""}const L=t=>{let r="";return Object.keys(t).forEach(o=>{x.startsWith(t[o],M.STYLES_KEY)&&(r=t[o])}),r},P=t=>{var j;const[,r]=n.useHighlightBlockId(),[o]=n.useHiddenBlockIds(),{isSelected:c}=t,{id:u,data:a}=t.node,g=t.depth*10,R=l=>{l.stopPropagation(),t.onToggle(t.node.id)},m=B.useDragOver(u,t.isOpen,t.onToggle),p=f.useMemo(()=>{const l=L(t.node.data);return H(l)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(u),className:q.cn("group flex w-full items-center justify-between space-x-px py-px",c?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:l=>{l.stopPropagation(),!o.includes(u)&&t.onSelect(u)},onContextMenu:()=>t.onSelect(u),style:{paddingInlineStart:g},...m,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:R,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(v,{type:a==null?void 0:a._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((j=t.node.data)==null?void 0:j._name)||t.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(c?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},F=t=>{var o;const{item:r}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(v,{type:(o=r==null?void 0:r.data)==null?void 0:o._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:r.text})]})},V=t=>{const r=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:r}})},z=()=>{const[t]=n.useSelectedBlockIds(),r=n.useRemoveBlocks(),o=n.useSelectedBlock();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDeleteBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},$=()=>{const[t]=n.useSelectedBlockIds(),r=n.useDuplicateBlocks(),o=n.useSelectedBlock(),c=f.useCallback(()=>{r(t)},[t,r]);return e.jsxRuntimeExports.jsxs(n.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:!n.canDuplicateBlock(o==null?void 0:o._type),className:"flex items-center gap-x-4 text-xs",onClick:c,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(z,{})]})},K=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx($,{})]})});function U(t){return x.map(t,r=>{const{data:o}=r;return{...o,_parent:r.parent===0?null:r.parent}})}function Q(){const[t]=n.useBlocksContainer(),[r,o]=n.useSelectedBlockIds();return t?e.jsxRuntimeExports.jsxs("div",{onClick:c=>{c.stopPropagation(),o(["container"])},className:q.cn("flex items-center pl-2 text-xs",x.includes(r,"container")?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),children:[e.jsxRuntimeExports.jsx(s.BoxIcon,{})," ",t._type]}):null}const Y=()=>{const[t]=n.useBlocksStore(),{setNewBlocks:r}=n.useBlocksStoreUndoableActions(),[o,c,u]=n.useSelectedBlockIds(),[,a]=n.useSelectedStylingBlocks(),{t:g}=O.useTranslation(),R=_.useExpandedIds(),m=A.useAddBlockByDrop(),[p]=n.useBlocksContainer(),j=async(i,d)=>{const{dragSource:h,relativeIndex:I,dropTargetId:b,monitor:k}=d;if(h){const D=U(i);r(D);const T=k.getItem();c([T.id])}else await m({block:k.getItem(),dropTargetId:b,relativeIndex:I})},l=x.map(t,i=>({id:i._id,text:i._type,parent:i._parent||0,droppable:!x.isUndefined(x.find(t,{_parent:i._id})),data:i})),w=()=>{c([]),a([])},[{isOver:E},C]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:i=>({canDrop:i.canDrop(),isOver:i.isOver()}),drop:i=>{(async()=>await m({block:i,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:S}=y.useDragLayer(i=>({isDragging:i.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>w(),className:q.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",S?"bg-green-50/80":"bg-background"),children:x.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:C,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${E?"bg-blue-200":""}`,children:[E?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:g(E?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsxs(n.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:[e.jsxRuntimeExports.jsx(Q,{}),e.jsxRuntimeExports.jsx(B.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:l,rootId:0,render:(i,{depth:d,isOpen:h,onToggle:I})=>e.jsxRuntimeExports.jsx(K,{id:i.id,children:e.jsxRuntimeExports.jsx(P,{onSelect:b=>{a([]),c([b])},isSelected:x.includes(o,i.id),node:i,depth:d,isOpen:h,onToggle:I,toggleIds:u})}),dragPreviewRender:i=>e.jsxRuntimeExports.jsx(F,{monitorProps:i}),onDrop:j,classes:{root:"h-[90%] "+(p?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:n.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(i,{depth:d})=>e.jsxRuntimeExports.jsx(V,{node:i,depth:d})})]})})})};exports.default=Y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("lodash-es"),s=require("@radix-ui/react-icons"),y=require("react-dnd"),k=require("@minoru/react-dnd-treeview"),O=require("react-i18next"),o=require("./index-ERorPL9q.cjs"),M=require("lucide-react"),B=require("react"),N=require("./MODIFIERS-2FeVfZQ9.cjs"),f=require("./Functions-N3yhPYKY.cjs"),_=require("./index-xJ8LmB04.cjs"),A=require("./useAddBlockByDrop-LBgi6GL7.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const w=t=>{switch(t.type){case"Image":return e.jsxRuntimeExports.jsx(s.ImageIcon,{});case"Heading":return e.jsxRuntimeExports.jsx(s.HeadingIcon,{});case"Text":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Link":return e.jsxRuntimeExports.jsx(s.Link1Icon,{});case"Video":return e.jsxRuntimeExports.jsx(s.VideoIcon,{});case"RichText":return e.jsxRuntimeExports.jsx(s.CursorTextIcon,{});case"Button":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"CustomHTML":return e.jsxRuntimeExports.jsx(s.CodeIcon,{});case"Divider":return e.jsxRuntimeExports.jsx(s.DividerHorizontalIcon,{});case"Icon":return e.jsxRuntimeExports.jsx(s.SketchLogoIcon,{});case"List":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"Paragraph":return e.jsxRuntimeExports.jsx(s.TextIcon,{});case"Row":return e.jsxRuntimeExports.jsx(s.RowsIcon,{});case"ListItem":return e.jsxRuntimeExports.jsx(s.ColumnsIcon,{});case"LineBreak":return e.jsxRuntimeExports.jsx(s.SpaceBetweenVerticallyIcon,{});case"Form":return e.jsxRuntimeExports.jsx(s.GroupIcon,{});case"Checkbox":return e.jsxRuntimeExports.jsx(s.CheckboxIcon,{});case"FormButton":return e.jsxRuntimeExports.jsx(s.ButtonIcon,{});case"Input":case"TextArea":return e.jsxRuntimeExports.jsx(s.InputIcon,{});case"Radio":return e.jsxRuntimeExports.jsx(s.RadiobuttonIcon,{});case"Select":return e.jsxRuntimeExports.jsx(s.DropdownMenuIcon,{});case"Table":return e.jsxRuntimeExports.jsx(s.TableIcon,{});case"TableHead":return e.jsxRuntimeExports.jsx(s.BorderTopIcon,{});case"TableBody":return e.jsxRuntimeExports.jsx(s.BorderAllIcon,{});case"TableRow":return e.jsxRuntimeExports.jsx(s.ViewHorizontalIcon,{});case"TableCell":return e.jsxRuntimeExports.jsx(s.DragHandleHorizontalIcon,{});case"DataProvider":return e.jsxRuntimeExports.jsx(M.DatabaseIcon,{size:16});case"Box":return e.jsxRuntimeExports.jsx(s.BoxIcon,{});default:return e.jsxRuntimeExports.jsx(s.BoxModelIcon,{})}};function H(t=""){const r={xs:"390px",sm:"640px",md:"768px",lg:"1024px",xl:"1366px","2xl":"1536px"};if(new RegExp(/\bsr-only\b/).test(t))return"Sr Only";if(new RegExp(/\b(sm|md|lg|xl|2xl):hidden\b/).test(t))return"Visible on mobile";if(t.match(/(^| )hidden( |$)/g)){const x=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),u=t.match(x);if(a.nth(u,1))return`Visible >=${r[a.nth(u,1)]}`}return""}const L=t=>{let r="";return Object.keys(t).forEach(i=>{a.startsWith(t[i],N.STYLES_KEY)&&(r=t[i])}),r},P=t=>{var j;const[,r]=o.useHighlightBlockId(),[i]=o.useHiddenBlockIds(),{isSelected:c}=t,{id:x,data:u}=t.node,g=t.depth*10,R=l=>{l.stopPropagation(),t.onToggle(t.node.id)},m=k.useDragOver(x,t.isOpen,t.onToggle),p=B.useMemo(()=>{const l=L(t.node.data);return H(l)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(x),className:f.cn("group flex w-full items-center justify-between space-x-px py-px",c?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:l=>{l.stopPropagation(),!i.includes(x)&&t.onSelect(x)},onContextMenu:()=>t.onSelect(x),style:{paddingInlineStart:g},...m,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:R,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(w,{type:u==null?void 0:u._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((j=t.node.data)==null?void 0:j._name)||t.node.text}),p?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(c?"text-gray-200":"text-gray-500"),children:["(",p,")"]}):null]})]})})},F=t=>{var i;const{item:r}=t.monitorProps;return e.jsxRuntimeExports.jsxs("div",{className:"flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700",children:[e.jsxRuntimeExports.jsx("div",{className:"",children:e.jsxRuntimeExports.jsx(w,{type:(i=r==null?void 0:r.data)==null?void 0:i._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:r.text})]})},V=t=>{const r=t.depth*10+16;return e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500",style:{left:r}})},z=()=>{const[t]=o.useSelectedBlockIds(),r=o.useRemoveBlocks(),i=o.useSelectedBlock();return e.jsxRuntimeExports.jsxs(o.ContextMenuItem,{disabled:!o.canDeleteBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},$=()=>{const[t]=o.useSelectedBlockIds(),r=o.useDuplicateBlocks(),i=o.useSelectedBlock(),c=B.useCallback(()=>{r(t)},[t,r]);return e.jsxRuntimeExports.jsxs(o.ContextMenuContent,{className:"text-xs",children:[e.jsxRuntimeExports.jsxs(o.ContextMenuItem,{disabled:!o.canDuplicateBlock(i==null?void 0:i._type),className:"flex items-center gap-x-4 text-xs",onClick:c,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx(z,{})]})},K=({children:t})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(o.ContextMenu,{children:[e.jsxRuntimeExports.jsx(o.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx($,{})]})});function U(t){return a.map(t,r=>{const{data:i}=r;return{...i,_parent:r.parent===0?null:r.parent}})}const Q=()=>{const[t]=o.useBlocksStore(),{setNewBlocks:r}=o.useBlocksStoreUndoableActions(),[i,c,x]=o.useSelectedBlockIds(),[,u]=o.useSelectedStylingBlocks(),{t:g}=O.useTranslation(),R=_.useExpandedIds(),m=A.useAddBlockByDrop(),[p]=o.useBlocksContainer(),j=async(n,d)=>{const{dragSource:h,relativeIndex:I,dropTargetId:b,monitor:q}=d;if(h){const T=U(n);r(T);const S=q.getItem();c([S.id])}else await m({block:q.getItem(),dropTargetId:b,relativeIndex:I})},l=a.map(t,n=>({id:n._id,text:n._type,parent:n._parent||0,droppable:!a.isUndefined(a.find(t,{_parent:n._id})),data:n})),v=()=>{c([]),u([])},[{isOver:E},C]=y.useDrop(()=>({accept:["CHAI_BLOCK"],collect:n=>({canDrop:n.canDrop(),isOver:n.isOver()}),drop:n=>{(async()=>await m({block:n,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:D}=y.useDragLayer(n=>({isDragging:n.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>v(),className:f.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",D?"bg-green-50/80":"bg-background"),children:a.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:C,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${E?"bg-blue-200":""}`,children:[E?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:g(E?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsx(o.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:e.jsxRuntimeExports.jsx(k.Tree,{initialOpen:R,extraAcceptTypes:["CHAI_BLOCK"],tree:l,rootId:0,render:(n,{depth:d,isOpen:h,onToggle:I})=>e.jsxRuntimeExports.jsx(K,{id:n.id,children:e.jsxRuntimeExports.jsx(P,{onSelect:b=>{u([]),c([b])},isSelected:a.includes(i,n.id),node:n,depth:d,isOpen:h,onToggle:I,toggleIds:x})}),dragPreviewRender:n=>e.jsxRuntimeExports.jsx(F,{monitorProps:n}),onDrop:j,classes:{root:"h-[90%] "+(p?"pl-2":"pt-2"),draggingSource:"opacity-30",dropTarget:"bg-green-100",placeholder:"relative"},sort:!1,insertDroppableFirst:!1,canDrop:o.canDropBlock,dropTargetOffset:2,enableAnimateExpand:!0,placeholderRender:(n,{depth:d})=>e.jsxRuntimeExports.jsx(V,{node:n,depth:d})})})})})};exports.default=Q;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { nth as
|
|
3
|
-
import { BoxModelIcon as
|
|
4
|
-
import { useDrop as
|
|
5
|
-
import { useDragOver as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { X as
|
|
2
|
+
import { nth as y, startsWith as M, map as v, isUndefined as H, find as A, isEmpty as L, includes as P } from "lodash-es";
|
|
3
|
+
import { BoxModelIcon as V, BoxIcon as F, DragHandleHorizontalIcon as z, ViewHorizontalIcon as K, BorderAllIcon as $, BorderTopIcon as Q, TableIcon as U, DropdownMenuIcon as q, RadiobuttonIcon as W, InputIcon as Y, ButtonIcon as k, CheckboxIcon as G, GroupIcon as X, SpaceBetweenVerticallyIcon as J, ColumnsIcon as Z, RowsIcon as B, TextIcon as w, SketchLogoIcon as ee, DividerHorizontalIcon as te, CodeIcon as se, CursorTextIcon as oe, VideoIcon as re, Link1Icon as ne, HeadingIcon as ae, ImageIcon as ce, TriangleRightIcon as ie, TrashIcon as le, CopyIcon as xe, DoubleArrowDownIcon as de, StackIcon as me } from "@radix-ui/react-icons";
|
|
4
|
+
import { useDrop as pe, useDragLayer as ue } from "react-dnd";
|
|
5
|
+
import { useDragOver as ge, Tree as je } from "@minoru/react-dnd-treeview";
|
|
6
|
+
import { useTranslation as he } from "react-i18next";
|
|
7
|
+
import { X as be, W as Ie, j as I, k as fe, a0 as C, bp as T, aQ as ye, l as ke, bq as Be, aP as we, br as ve, bs as Ce, s as Te, aK as De, ac as Se, bt as Ne, bf as Oe, bu as Re } from "./index-QGA4ayU7.js";
|
|
8
8
|
import { DatabaseIcon as _e } from "lucide-react";
|
|
9
9
|
import { useMemo as Ee, useCallback as Me } from "react";
|
|
10
10
|
import { a as He } from "./MODIFIERS-RiXS5Mn1.js";
|
|
11
|
-
import { c as
|
|
12
|
-
import { f as Ae } from "./index-
|
|
13
|
-
import { u as Le } from "./useAddBlockByDrop-
|
|
11
|
+
import { c as D } from "./Functions-7jnEwJyw.js";
|
|
12
|
+
import { f as Ae } from "./index-nrRnwUaC.js";
|
|
13
|
+
import { u as Le } from "./useAddBlockByDrop-Y-g4O8UC.js";
|
|
14
14
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
15
|
import "@chaibuilder/runtime";
|
|
16
16
|
import "jotai";
|
|
@@ -52,67 +52,67 @@ import "./html-to-json-57841sEK.js";
|
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "./web-blocks.js";
|
|
54
54
|
import "./empty-slot-5FRrRq1E.js";
|
|
55
|
-
const
|
|
55
|
+
const S = (t) => {
|
|
56
56
|
switch (t.type) {
|
|
57
57
|
case "Image":
|
|
58
|
-
return /* @__PURE__ */ e.jsx(ie, {});
|
|
59
|
-
case "Heading":
|
|
60
58
|
return /* @__PURE__ */ e.jsx(ce, {});
|
|
59
|
+
case "Heading":
|
|
60
|
+
return /* @__PURE__ */ e.jsx(ae, {});
|
|
61
61
|
case "Text":
|
|
62
62
|
return /* @__PURE__ */ e.jsx(w, {});
|
|
63
63
|
case "Link":
|
|
64
|
-
return /* @__PURE__ */ e.jsx(
|
|
64
|
+
return /* @__PURE__ */ e.jsx(ne, {});
|
|
65
65
|
case "Video":
|
|
66
66
|
return /* @__PURE__ */ e.jsx(re, {});
|
|
67
67
|
case "RichText":
|
|
68
68
|
return /* @__PURE__ */ e.jsx(oe, {});
|
|
69
69
|
case "Button":
|
|
70
|
-
return /* @__PURE__ */ e.jsx(
|
|
70
|
+
return /* @__PURE__ */ e.jsx(k, {});
|
|
71
71
|
case "CustomHTML":
|
|
72
|
-
return /* @__PURE__ */ e.jsx(ne, {});
|
|
73
|
-
case "Divider":
|
|
74
72
|
return /* @__PURE__ */ e.jsx(se, {});
|
|
75
|
-
case "
|
|
73
|
+
case "Divider":
|
|
76
74
|
return /* @__PURE__ */ e.jsx(te, {});
|
|
75
|
+
case "Icon":
|
|
76
|
+
return /* @__PURE__ */ e.jsx(ee, {});
|
|
77
77
|
case "List":
|
|
78
|
-
return /* @__PURE__ */ e.jsx(
|
|
78
|
+
return /* @__PURE__ */ e.jsx(B, {});
|
|
79
79
|
case "Paragraph":
|
|
80
80
|
return /* @__PURE__ */ e.jsx(w, {});
|
|
81
81
|
case "Row":
|
|
82
|
-
return /* @__PURE__ */ e.jsx(
|
|
82
|
+
return /* @__PURE__ */ e.jsx(B, {});
|
|
83
83
|
case "ListItem":
|
|
84
|
-
return /* @__PURE__ */ e.jsx(ee, {});
|
|
85
|
-
case "LineBreak":
|
|
86
84
|
return /* @__PURE__ */ e.jsx(Z, {});
|
|
87
|
-
case "
|
|
85
|
+
case "LineBreak":
|
|
88
86
|
return /* @__PURE__ */ e.jsx(J, {});
|
|
89
|
-
case "
|
|
87
|
+
case "Form":
|
|
90
88
|
return /* @__PURE__ */ e.jsx(X, {});
|
|
89
|
+
case "Checkbox":
|
|
90
|
+
return /* @__PURE__ */ e.jsx(G, {});
|
|
91
91
|
case "FormButton":
|
|
92
|
-
return /* @__PURE__ */ e.jsx(
|
|
92
|
+
return /* @__PURE__ */ e.jsx(k, {});
|
|
93
93
|
case "Input":
|
|
94
94
|
case "TextArea":
|
|
95
|
-
return /* @__PURE__ */ e.jsx(G, {});
|
|
96
|
-
case "Radio":
|
|
97
95
|
return /* @__PURE__ */ e.jsx(Y, {});
|
|
98
|
-
case "
|
|
96
|
+
case "Radio":
|
|
99
97
|
return /* @__PURE__ */ e.jsx(W, {});
|
|
100
|
-
case "
|
|
98
|
+
case "Select":
|
|
101
99
|
return /* @__PURE__ */ e.jsx(q, {});
|
|
102
|
-
case "
|
|
100
|
+
case "Table":
|
|
103
101
|
return /* @__PURE__ */ e.jsx(U, {});
|
|
104
|
-
case "
|
|
102
|
+
case "TableHead":
|
|
105
103
|
return /* @__PURE__ */ e.jsx(Q, {});
|
|
106
|
-
case "
|
|
104
|
+
case "TableBody":
|
|
107
105
|
return /* @__PURE__ */ e.jsx($, {});
|
|
108
|
-
case "
|
|
106
|
+
case "TableRow":
|
|
109
107
|
return /* @__PURE__ */ e.jsx(K, {});
|
|
108
|
+
case "TableCell":
|
|
109
|
+
return /* @__PURE__ */ e.jsx(z, {});
|
|
110
110
|
case "DataProvider":
|
|
111
111
|
return /* @__PURE__ */ e.jsx(_e, { size: 16 });
|
|
112
112
|
case "Box":
|
|
113
|
-
return /* @__PURE__ */ e.jsx(
|
|
113
|
+
return /* @__PURE__ */ e.jsx(F, {});
|
|
114
114
|
default:
|
|
115
|
-
return /* @__PURE__ */ e.jsx(
|
|
115
|
+
return /* @__PURE__ */ e.jsx(V, {});
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
function Pe(t = "") {
|
|
@@ -133,21 +133,21 @@ function Pe(t = "") {
|
|
|
133
133
|
// checks if any of the display property is set for any higher media query
|
|
134
134
|
/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/
|
|
135
135
|
), c = t.match(a);
|
|
136
|
-
if (
|
|
137
|
-
return `Visible >=${s[
|
|
136
|
+
if (y(c, 1))
|
|
137
|
+
return `Visible >=${s[y(c, 1)]}`;
|
|
138
138
|
}
|
|
139
139
|
return "";
|
|
140
140
|
}
|
|
141
141
|
const Ve = (t) => {
|
|
142
142
|
let s = "";
|
|
143
|
-
return Object.keys(t).forEach((
|
|
144
|
-
|
|
143
|
+
return Object.keys(t).forEach((r) => {
|
|
144
|
+
M(t[r], He) && (s = t[r]);
|
|
145
145
|
}), s;
|
|
146
146
|
}, Fe = (t) => {
|
|
147
147
|
var m;
|
|
148
|
-
const [, s] =
|
|
148
|
+
const [, s] = be(), [r] = Ie(), { isSelected: n } = t, { id: a, data: c } = t.node, p = t.depth * 10, u = (i) => {
|
|
149
149
|
i.stopPropagation(), t.onToggle(t.node.id);
|
|
150
|
-
}, x =
|
|
150
|
+
}, x = ge(a, t.isOpen, t.onToggle), d = Ee(() => {
|
|
151
151
|
const i = Ve(t.node.data);
|
|
152
152
|
return Pe(i);
|
|
153
153
|
}, [t.node.data]);
|
|
@@ -157,31 +157,31 @@ const Ve = (t) => {
|
|
|
157
157
|
"div",
|
|
158
158
|
{
|
|
159
159
|
onMouseEnter: () => s(a),
|
|
160
|
-
className:
|
|
160
|
+
className: D(
|
|
161
161
|
"group flex w-full items-center justify-between space-x-px py-px",
|
|
162
|
-
|
|
162
|
+
n ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
163
163
|
),
|
|
164
164
|
onClick: (i) => {
|
|
165
|
-
i.stopPropagation(), !
|
|
165
|
+
i.stopPropagation(), !r.includes(a) && t.onSelect(a);
|
|
166
166
|
},
|
|
167
167
|
onContextMenu: () => t.onSelect(a),
|
|
168
|
-
style: { paddingInlineStart:
|
|
168
|
+
style: { paddingInlineStart: p },
|
|
169
169
|
...x,
|
|
170
170
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
171
171
|
/* @__PURE__ */ e.jsx(
|
|
172
172
|
"div",
|
|
173
173
|
{
|
|
174
174
|
className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen ? "rotate-90" : ""}`,
|
|
175
|
-
children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick:
|
|
175
|
+
children: t.node.droppable && /* @__PURE__ */ e.jsx("button", { onClick: u, type: "button", children: /* @__PURE__ */ e.jsx(ie, {}) })
|
|
176
176
|
}
|
|
177
177
|
),
|
|
178
178
|
/* @__PURE__ */ e.jsxs("button", { type: "button", className: "flex items-center", children: [
|
|
179
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(
|
|
179
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mt-1 h-3 w-3", children: /* @__PURE__ */ e.jsx(S, { type: c == null ? void 0 : c._type }) }),
|
|
180
180
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: ((m = t.node.data) == null ? void 0 : m._name) || t.node.text }),
|
|
181
181
|
d ? /* @__PURE__ */ e.jsxs(
|
|
182
182
|
"span",
|
|
183
183
|
{
|
|
184
|
-
className: "ml-2 flex items-center text-[10px] italic " + (
|
|
184
|
+
className: "ml-2 flex items-center text-[10px] italic " + (n ? "text-gray-200" : "text-gray-500"),
|
|
185
185
|
children: [
|
|
186
186
|
"(",
|
|
187
187
|
d,
|
|
@@ -195,100 +195,80 @@ const Ve = (t) => {
|
|
|
195
195
|
)
|
|
196
196
|
);
|
|
197
197
|
}, ze = (t) => {
|
|
198
|
-
var
|
|
198
|
+
var r;
|
|
199
199
|
const { item: s } = t.monitorProps;
|
|
200
200
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex w-max items-center bg-blue-200 bg-opacity-30 p-1 font-semibold text-blue-700", children: [
|
|
201
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
201
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx(S, { type: (r = s == null ? void 0 : s.data) == null ? void 0 : r._type }) }),
|
|
202
202
|
/* @__PURE__ */ e.jsx("div", { className: "ml-2 truncate text-[11px]", children: s.text })
|
|
203
203
|
] });
|
|
204
204
|
}, Ke = (t) => {
|
|
205
205
|
const s = t.depth * 10 + 16;
|
|
206
206
|
return /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 top-0 h-0.5 -translate-y-1/2 transform bg-green-500", style: { left: s } });
|
|
207
207
|
}, $e = () => {
|
|
208
|
-
const [t] =
|
|
208
|
+
const [t] = I(), s = fe(), r = C();
|
|
209
209
|
return /* @__PURE__ */ e.jsxs(
|
|
210
|
-
|
|
210
|
+
T,
|
|
211
211
|
{
|
|
212
|
-
disabled: !
|
|
212
|
+
disabled: !ye(r == null ? void 0 : r._type),
|
|
213
213
|
className: "flex items-center gap-x-4 text-xs",
|
|
214
214
|
onClick: () => s(t),
|
|
215
215
|
children: [
|
|
216
|
-
/* @__PURE__ */ e.jsx(
|
|
216
|
+
/* @__PURE__ */ e.jsx(le, {}),
|
|
217
217
|
" Remove"
|
|
218
218
|
]
|
|
219
219
|
}
|
|
220
220
|
);
|
|
221
221
|
}, Qe = () => {
|
|
222
|
-
const [t] =
|
|
222
|
+
const [t] = I(), s = ke(), r = C(), n = Me(() => {
|
|
223
223
|
s(t);
|
|
224
224
|
}, [t, s]);
|
|
225
|
-
return /* @__PURE__ */ e.jsxs(
|
|
225
|
+
return /* @__PURE__ */ e.jsxs(Be, { className: "text-xs", children: [
|
|
226
226
|
/* @__PURE__ */ e.jsxs(
|
|
227
|
-
|
|
227
|
+
T,
|
|
228
228
|
{
|
|
229
|
-
disabled: !we(
|
|
229
|
+
disabled: !we(r == null ? void 0 : r._type),
|
|
230
230
|
className: "flex items-center gap-x-4 text-xs",
|
|
231
|
-
onClick:
|
|
231
|
+
onClick: n,
|
|
232
232
|
children: [
|
|
233
|
-
/* @__PURE__ */ e.jsx(
|
|
233
|
+
/* @__PURE__ */ e.jsx(xe, {}),
|
|
234
234
|
" Duplicate"
|
|
235
235
|
]
|
|
236
236
|
}
|
|
237
237
|
),
|
|
238
238
|
/* @__PURE__ */ e.jsx($e, {})
|
|
239
239
|
] });
|
|
240
|
-
}, Ue = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
241
|
-
/* @__PURE__ */ e.jsx(
|
|
240
|
+
}, Ue = ({ children: t }) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
241
|
+
/* @__PURE__ */ e.jsx(Ce, { children: t }),
|
|
242
242
|
/* @__PURE__ */ e.jsx(Qe, {})
|
|
243
243
|
] }) });
|
|
244
244
|
function qe(t) {
|
|
245
|
-
return
|
|
246
|
-
const { data:
|
|
245
|
+
return v(t, (s) => {
|
|
246
|
+
const { data: r } = s;
|
|
247
247
|
return {
|
|
248
|
-
...
|
|
248
|
+
...r,
|
|
249
249
|
_parent: s.parent === 0 ? null : s.parent
|
|
250
250
|
};
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
|
-
|
|
254
|
-
const [t] =
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
className: I(
|
|
262
|
-
"flex items-center pl-2 text-xs",
|
|
263
|
-
T(s, "container") ? "bg-blue-500 text-white" : "hover:bg-gray-200 dark:hover:bg-gray-800"
|
|
264
|
-
),
|
|
265
|
-
children: [
|
|
266
|
-
/* @__PURE__ */ e.jsx(D, {}),
|
|
267
|
-
" ",
|
|
268
|
-
t._type
|
|
269
|
-
]
|
|
270
|
-
}
|
|
271
|
-
) : null;
|
|
272
|
-
}
|
|
273
|
-
const Yt = () => {
|
|
274
|
-
const [t] = De(), { setNewBlocks: s } = Se(), [n, r, a] = p(), [, c] = Ne(), { t: u } = be(), g = Ae(), x = Le(), [d] = O(), m = async (o, l) => {
|
|
275
|
-
const { dragSource: h, relativeIndex: b, dropTargetId: f, monitor: y } = l;
|
|
276
|
-
if (h) {
|
|
277
|
-
const H = qe(o);
|
|
278
|
-
s(H);
|
|
279
|
-
const A = y.getItem();
|
|
280
|
-
r([A.id]);
|
|
253
|
+
const Wt = () => {
|
|
254
|
+
const [t] = Te(), { setNewBlocks: s } = De(), [r, n, a] = I(), [, c] = Se(), { t: p } = he(), u = Ae(), x = Le(), [d] = Ne(), m = async (o, l) => {
|
|
255
|
+
const { dragSource: j, relativeIndex: h, dropTargetId: b, monitor: f } = l;
|
|
256
|
+
if (j) {
|
|
257
|
+
const _ = qe(o);
|
|
258
|
+
s(_);
|
|
259
|
+
const E = f.getItem();
|
|
260
|
+
n([E.id]);
|
|
281
261
|
} else
|
|
282
|
-
await x({ block:
|
|
283
|
-
}, i =
|
|
262
|
+
await x({ block: f.getItem(), dropTargetId: b, relativeIndex: h });
|
|
263
|
+
}, i = v(t, (o) => ({
|
|
284
264
|
id: o._id,
|
|
285
265
|
text: o._type,
|
|
286
266
|
parent: o._parent || 0,
|
|
287
|
-
droppable: !
|
|
267
|
+
droppable: !H(A(t, { _parent: o._id })),
|
|
288
268
|
data: o
|
|
289
|
-
})),
|
|
290
|
-
|
|
291
|
-
}, [{ isOver:
|
|
269
|
+
})), N = () => {
|
|
270
|
+
n([]), c([]);
|
|
271
|
+
}, [{ isOver: g }, O] = pe(() => ({
|
|
292
272
|
accept: ["CHAI_BLOCK"],
|
|
293
273
|
collect: (o) => ({
|
|
294
274
|
canDrop: o.canDrop(),
|
|
@@ -301,70 +281,67 @@ const Yt = () => {
|
|
|
301
281
|
relativeIndex: 0
|
|
302
282
|
}))();
|
|
303
283
|
}
|
|
304
|
-
})), { isDragging:
|
|
284
|
+
})), { isDragging: R } = ue((o) => ({
|
|
305
285
|
isDragging: o.isDragging()
|
|
306
286
|
}));
|
|
307
287
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
308
288
|
"div",
|
|
309
289
|
{
|
|
310
|
-
onClick: () =>
|
|
311
|
-
className:
|
|
290
|
+
onClick: () => N(),
|
|
291
|
+
className: D(
|
|
312
292
|
"-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
|
|
313
|
-
|
|
293
|
+
R ? "bg-green-50/80" : "bg-background"
|
|
314
294
|
),
|
|
315
|
-
children:
|
|
295
|
+
children: L(t) ? /* @__PURE__ */ e.jsxs(
|
|
316
296
|
"div",
|
|
317
297
|
{
|
|
318
|
-
ref:
|
|
319
|
-
className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${
|
|
298
|
+
ref: O,
|
|
299
|
+
className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${g ? "bg-blue-200" : ""}`,
|
|
320
300
|
children: [
|
|
321
|
-
|
|
322
|
-
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children:
|
|
301
|
+
g ? /* @__PURE__ */ e.jsx(de, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-10 w-10" }),
|
|
302
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-2", children: p(g ? "drop_here_message" : "tree_view_no_blocks") })
|
|
323
303
|
]
|
|
324
304
|
}
|
|
325
|
-
) : /* @__PURE__ */ e.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
] })
|
|
305
|
+
) : /* @__PURE__ */ e.jsx(Oe, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: /* @__PURE__ */ e.jsx(
|
|
306
|
+
je,
|
|
307
|
+
{
|
|
308
|
+
initialOpen: u,
|
|
309
|
+
extraAcceptTypes: ["CHAI_BLOCK"],
|
|
310
|
+
tree: i,
|
|
311
|
+
rootId: 0,
|
|
312
|
+
render: (o, { depth: l, isOpen: j, onToggle: h }) => /* @__PURE__ */ e.jsx(Ue, { id: o.id, children: /* @__PURE__ */ e.jsx(
|
|
313
|
+
Fe,
|
|
314
|
+
{
|
|
315
|
+
onSelect: (b) => {
|
|
316
|
+
c([]), n([b]);
|
|
317
|
+
},
|
|
318
|
+
isSelected: P(r, o.id),
|
|
319
|
+
node: o,
|
|
320
|
+
depth: l,
|
|
321
|
+
isOpen: j,
|
|
322
|
+
onToggle: h,
|
|
323
|
+
toggleIds: a
|
|
324
|
+
}
|
|
325
|
+
) }),
|
|
326
|
+
dragPreviewRender: (o) => /* @__PURE__ */ e.jsx(ze, { monitorProps: o }),
|
|
327
|
+
onDrop: m,
|
|
328
|
+
classes: {
|
|
329
|
+
root: "h-[90%] " + (d ? "pl-2" : "pt-2"),
|
|
330
|
+
draggingSource: "opacity-30",
|
|
331
|
+
dropTarget: "bg-green-100",
|
|
332
|
+
placeholder: "relative"
|
|
333
|
+
},
|
|
334
|
+
sort: !1,
|
|
335
|
+
insertDroppableFirst: !1,
|
|
336
|
+
canDrop: Re,
|
|
337
|
+
dropTargetOffset: 2,
|
|
338
|
+
enableAnimateExpand: !0,
|
|
339
|
+
placeholderRender: (o, { depth: l }) => /* @__PURE__ */ e.jsx(Ke, { node: o, depth: l })
|
|
340
|
+
}
|
|
341
|
+
) })
|
|
365
342
|
}
|
|
366
343
|
) });
|
|
367
344
|
};
|
|
368
345
|
export {
|
|
369
|
-
|
|
346
|
+
Wt as default
|
|
370
347
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import i, { Suspense as s } from "react";
|
|
3
3
|
import { sortBy as a, filter as d, get as n } from "lodash-es";
|
|
4
|
-
import { a as l, b as c } from "./index-
|
|
4
|
+
import { a as l, b as c } from "./index-nrRnwUaC.js";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "i18next";
|
|
7
7
|
import "react-i18next";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-QGA4ayU7.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
11
11
|
import "tailwind-merge";
|
|
@@ -51,7 +51,7 @@ import "himalaya";
|
|
|
51
51
|
import "lucide-react";
|
|
52
52
|
import "./web-blocks.js";
|
|
53
53
|
import "./empty-slot-5FRrRq1E.js";
|
|
54
|
-
const x = i.lazy(() => import("./add-page-modal-
|
|
54
|
+
const x = i.lazy(() => import("./add-page-modal-nZJaunuz.js")), g = i.lazy(() => import("./page-viewer-U7o88VvR.js")), gt = () => {
|
|
55
55
|
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);
|
|
56
56
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
57
57
|
/* @__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-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),i=require("lodash-es"),s=require("./index-xJ8LmB04.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-ERorPL9q.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-KixvLXAG.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-Nn__90Uo.cjs"))),d=()=>{const{data:t=[],isLoading:q}=s.usePages(),{data:r}=s.useProject(),n=i.sortBy(i.filter(t,{type:"STATIC"}),o=>i.get(o,"uuid")===(r==null?void 0:r.homepage)?0:1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Pages"}),e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"text-sm text-blue-500 underline",children:"+ New Page"}),children:e.jsxRuntimeExports.jsx(a,{})})]}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1 divide-y-2",children:e.jsxRuntimeExports.jsx(x,{isLoading:q,pages:n})})]})};exports.default=d;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.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-es";
|
|
4
|
-
import { b8 as f, b9 as n, ba as l, bb as c } from "./index-
|
|
5
|
-
import { c as h, b as g } from "./index-
|
|
4
|
+
import { b8 as f, b9 as n, ba as l, bb as c } from "./index-QGA4ayU7.js";
|
|
5
|
+
import { c as h, b as g } from "./index-nrRnwUaC.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "./Functions-7jnEwJyw.js";
|
|
8
8
|
import "clsx";
|
|
@@ -51,7 +51,7 @@ import "himalaya";
|
|
|
51
51
|
import "lucide-react";
|
|
52
52
|
import "./web-blocks.js";
|
|
53
53
|
import "./empty-slot-5FRrRq1E.js";
|
|
54
|
-
const N = m.lazy(() => import("./project-general-setting-
|
|
54
|
+
const N = m.lazy(() => import("./project-general-setting-h0TeKYRf.js")), S = m.lazy(() => import("./project-seo-setting-Sl6AE-Q7.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) ? {
|
|
55
55
|
...r,
|
|
56
56
|
seoData: { title: "", description: "", image: "" }
|
|
57
57
|
} : r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),x=require("lodash-es"),s=require("./index-ERorPL9q.cjs"),a=require("./index-xJ8LmB04.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-C98_GooL.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-8oJUrOqk.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 q(){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(m,{_projectData:i,seany:o})})})]})]})})]})}exports.default=q;
|