@chaibuilder/sdk 1.2.14 → 1.2.16

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.
Files changed (55) hide show
  1. package/dist/{AddBlocks-tomDo_Is.cjs → AddBlocks-FUKuRbn6.cjs} +1 -1
  2. package/dist/{AddBlocks-zN5--UP6.js → AddBlocks-TBFBvBvo.js} +76 -70
  3. package/dist/{BrandingOptions-BUmE4f72.cjs → BrandingOptions-tBWzqas5.cjs} +1 -1
  4. package/dist/{BrandingOptions-LbizrmRI.js → BrandingOptions-t_MjeHSM.js} +1 -1
  5. package/dist/{CanvasArea-leUzGAdQ.js → CanvasArea-ZYC8QbQB.js} +3 -3
  6. package/dist/{CanvasArea-1PwexKQz.cjs → CanvasArea-oTylYgH9.cjs} +4 -4
  7. package/dist/{CurrentPage-XSq62fdk.js → CurrentPage-4vC6olJo.js} +2 -2
  8. package/dist/{CurrentPage-M6uJPKhj.cjs → CurrentPage-g8aT56B2.cjs} +1 -1
  9. package/dist/{Layers-tasAbEc8.cjs → Layers-fEb6biiU.cjs} +1 -1
  10. package/dist/{Layers-JoV3wull.js → Layers-m61dThGR.js} +125 -148
  11. package/dist/{PagesPanel-v1B780fd.cjs → PagesPanel-ewHplHej.cjs} +1 -1
  12. package/dist/{PagesPanel-5KjlPTtj.js → PagesPanel-v3KV_vfG.js} +3 -3
  13. package/dist/{ProjectPanel-NZYWWYTt.cjs → ProjectPanel-pgpe3fyR.cjs} +1 -1
  14. package/dist/{ProjectPanel-4X2KLnOi.js → ProjectPanel-xsUuVX64.js} +3 -3
  15. package/dist/{Settings-1WP3BWxr.js → Settings-ZNxfF14G.js} +2 -2
  16. package/dist/{Settings-FW-bX28i.cjs → Settings-zk2jUrHc.cjs} +1 -1
  17. package/dist/{SidePanels-ZlDXRldT.js → SidePanels-MbJufIbe.js} +68 -68
  18. package/dist/{SidePanels-YpyBLRub.cjs → SidePanels-zXHw8T3P.cjs} +1 -1
  19. package/dist/{Topbar-2sOsQD2d.cjs → Topbar-iH2L4pe0.cjs} +1 -1
  20. package/dist/{Topbar-xvrno03z.js → Topbar-ryFhl-PC.js} +1 -1
  21. package/dist/{UnsplashImages-EiYSWkBa.cjs → UnsplashImages-SrxA-yNu.cjs} +1 -1
  22. package/dist/{UnsplashImages-hhPOf7kt.js → UnsplashImages-ppQXZ28F.js} +1 -1
  23. package/dist/{UploadImages-JKjE44i7.js → UploadImages-IKR4oX2k.js} +1 -1
  24. package/dist/{UploadImages-GGCExfQd.cjs → UploadImages-VBiO6lqp.cjs} +1 -1
  25. package/dist/{add-page-modal-ueEpfep_.cjs → add-page-modal-myA0a2nW.cjs} +1 -1
  26. package/dist/{add-page-modal-iYgzDs08.js → add-page-modal-pc5-Yw4C.js} +3 -3
  27. package/dist/{confirm-alert-Nw1JCtuu.js → confirm-alert-QKtbNbWz.js} +1 -1
  28. package/dist/{confirm-alert-_DCO6hCV.cjs → confirm-alert-uV_PtYc3.cjs} +1 -1
  29. package/dist/core.cjs +1 -1
  30. package/dist/core.js +2 -2
  31. package/dist/{delete-page-modal-hlR-A69E.js → delete-page-modal-Zf3-4wLg.js} +2 -2
  32. package/dist/{delete-page-modal-CT-ZA6H5.cjs → delete-page-modal-q4G_-zBl.cjs} +1 -1
  33. package/dist/email.cjs +1 -1
  34. package/dist/email.js +2 -2
  35. package/dist/{form-vNgf0kO2.cjs → form-KkP1F7h1.cjs} +1 -1
  36. package/dist/{form-lbFCPUoE.js → form-faX0Yn4Q.js} +1 -1
  37. package/dist/{index-TBa4RPnS.cjs → index-DT71IahS.cjs} +42 -42
  38. package/dist/{index-bfKqnRvZ.cjs → index-ERorPL9q.cjs} +1 -1
  39. package/dist/{index-m9VziIOy.js → index-QGA4ayU7.js} +275 -275
  40. package/dist/{index-DXznIJrr.js → index-rktN6W1Y.js} +3190 -3187
  41. package/dist/{page-viewer-Hgr72mrQ.js → page-viewer-Cv_WZY-t.js} +3 -3
  42. package/dist/{page-viewer-voX6SLpK.cjs → page-viewer-z9Kn4i1K.cjs} +1 -1
  43. package/dist/{project-general-setting-VFFXhGpN.cjs → project-general-setting-ZiLidijs.cjs} +1 -1
  44. package/dist/{project-general-setting-OdZj-lfx.js → project-general-setting-x6qqF0T8.js} +3 -3
  45. package/dist/{project-seo-setting-aRDdqu88.cjs → project-seo-setting-8oJUrOqk.cjs} +1 -1
  46. package/dist/{project-seo-setting-9V67NFil.js → project-seo-setting-Sl6AE-Q7.js} +2 -2
  47. package/dist/{single-page-detail-FIwXvGx2.cjs → single-page-detail-cnwttu4D.cjs} +1 -1
  48. package/dist/{single-page-detail-AjhWBVK1.js → single-page-detail-sGbwXXs1.js} +4 -4
  49. package/dist/studio.cjs +1 -1
  50. package/dist/studio.js +2 -2
  51. package/dist/ui.cjs +1 -1
  52. package/dist/ui.js +1 -1
  53. package/dist/{useAddBlockByDrop-1WvPoBXa.cjs → useAddBlockByDrop-LBgi6GL7.cjs} +1 -1
  54. package/dist/{useAddBlockByDrop-bs_SH7Tw.js → useAddBlockByDrop-Y-g4O8UC.js} +1 -1
  55. package/package.json +1 -1
@@ -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-m9VziIOy.js";
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-DXznIJrr.js";
6
+ import { b as S, a as B, d as E, e as I } from "./index-rktN6W1Y.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"),t=require("./index-bfKqnRvZ.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-TBa4RPnS.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
+ "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-DT71IahS.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 +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-DT71IahS.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 k, startsWith as L, map as C, includes as T, isUndefined as P, find as V, isEmpty as F } from "lodash-es";
3
- import { BoxModelIcon as z, BoxIcon as D, DragHandleHorizontalIcon as K, ViewHorizontalIcon as $, BorderAllIcon as Q, BorderTopIcon as U, TableIcon as q, DropdownMenuIcon as W, RadiobuttonIcon as Y, InputIcon as G, ButtonIcon as B, CheckboxIcon as X, GroupIcon as J, SpaceBetweenVerticallyIcon as Z, ColumnsIcon as ee, RowsIcon as v, TextIcon as w, SketchLogoIcon as te, DividerHorizontalIcon as se, CodeIcon as ne, CursorTextIcon as oe, VideoIcon as re, Link1Icon as ae, HeadingIcon as ce, ImageIcon as ie, TriangleRightIcon as le, TrashIcon as xe, CopyIcon as de, DoubleArrowDownIcon as me, StackIcon as pe } from "@radix-ui/react-icons";
4
- import { useDrop as ue, useDragLayer as ge } from "react-dnd";
5
- import { useDragOver as je, Tree as he } from "@minoru/react-dnd-treeview";
6
- import { useTranslation as be } from "react-i18next";
7
- import { X as fe, W as Ie, j as p, k as ye, a0 as S, bp as N, aQ as ke, l as Be, bq as ve, aP as we, br as Ce, bs as Te, bt as O, s as De, aK as Se, ac as Ne, bf as Oe, bu as Re } from "./index-m9VziIOy.js";
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 I } from "./Functions-7jnEwJyw.js";
12
- import { f as Ae } from "./index-DXznIJrr.js";
13
- import { u as Le } from "./useAddBlockByDrop-bs_SH7Tw.js";
11
+ import { c as D } from "./Functions-7jnEwJyw.js";
12
+ import { f as Ae } from "./index-rktN6W1Y.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 R = (t) => {
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(ae, {});
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(B, {});
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 "Icon":
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(v, {});
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(v, {});
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 "Form":
85
+ case "LineBreak":
88
86
  return /* @__PURE__ */ e.jsx(J, {});
89
- case "Checkbox":
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(B, {});
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 "Select":
96
+ case "Radio":
99
97
  return /* @__PURE__ */ e.jsx(W, {});
100
- case "Table":
98
+ case "Select":
101
99
  return /* @__PURE__ */ e.jsx(q, {});
102
- case "TableHead":
100
+ case "Table":
103
101
  return /* @__PURE__ */ e.jsx(U, {});
104
- case "TableBody":
102
+ case "TableHead":
105
103
  return /* @__PURE__ */ e.jsx(Q, {});
106
- case "TableRow":
104
+ case "TableBody":
107
105
  return /* @__PURE__ */ e.jsx($, {});
108
- case "TableCell":
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(D, {});
113
+ return /* @__PURE__ */ e.jsx(F, {});
114
114
  default:
115
- return /* @__PURE__ */ e.jsx(z, {});
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 (k(c, 1))
137
- return `Visible >=${s[k(c, 1)]}`;
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((n) => {
144
- L(t[n], He) && (s = t[n]);
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] = fe(), [n] = Ie(), { isSelected: r } = t, { id: a, data: c } = t.node, u = t.depth * 10, g = (i) => {
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 = je(a, t.isOpen, t.onToggle), d = Ee(() => {
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: I(
160
+ className: D(
161
161
  "group flex w-full items-center justify-between space-x-px py-px",
162
- r ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800"
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(), !n.includes(a) && t.onSelect(a);
165
+ i.stopPropagation(), !r.includes(a) && t.onSelect(a);
166
166
  },
167
167
  onContextMenu: () => t.onSelect(a),
168
- style: { paddingInlineStart: u },
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: g, type: "button", children: /* @__PURE__ */ e.jsx(le, {}) })
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(R, { type: c == null ? void 0 : c._type }) }),
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 " + (r ? "text-gray-200" : "text-gray-500"),
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 n;
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(R, { type: (n = s == null ? void 0 : s.data) == null ? void 0 : n._type }) }),
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] = p(), s = ye(), n = S();
208
+ const [t] = I(), s = fe(), r = C();
209
209
  return /* @__PURE__ */ e.jsxs(
210
- N,
210
+ T,
211
211
  {
212
- disabled: !ke(n == null ? void 0 : n._type),
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(xe, {}),
216
+ /* @__PURE__ */ e.jsx(le, {}),
217
217
  " Remove"
218
218
  ]
219
219
  }
220
220
  );
221
221
  }, Qe = () => {
222
- const [t] = p(), s = Be(), n = S(), r = Me(() => {
222
+ const [t] = I(), s = ke(), r = C(), n = Me(() => {
223
223
  s(t);
224
224
  }, [t, s]);
225
- return /* @__PURE__ */ e.jsxs(ve, { className: "text-xs", children: [
225
+ return /* @__PURE__ */ e.jsxs(Be, { className: "text-xs", children: [
226
226
  /* @__PURE__ */ e.jsxs(
227
- N,
227
+ T,
228
228
  {
229
- disabled: !we(n == null ? void 0 : n._type),
229
+ disabled: !we(r == null ? void 0 : r._type),
230
230
  className: "flex items-center gap-x-4 text-xs",
231
- onClick: r,
231
+ onClick: n,
232
232
  children: [
233
- /* @__PURE__ */ e.jsx(de, {}),
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(Ce, { children: [
241
- /* @__PURE__ */ e.jsx(Te, { children: t }),
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 C(t, (s) => {
246
- const { data: n } = s;
245
+ return v(t, (s) => {
246
+ const { data: r } = s;
247
247
  return {
248
- ...n,
248
+ ...r,
249
249
  _parent: s.parent === 0 ? null : s.parent
250
250
  };
251
251
  });
252
252
  }
253
- function We() {
254
- const [t] = O(), [s, n] = p();
255
- return t ? /* @__PURE__ */ e.jsxs(
256
- "div",
257
- {
258
- onClick: (r) => {
259
- r.stopPropagation(), n(["container"]);
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: y.getItem(), dropTargetId: f, relativeIndex: b });
283
- }, i = C(t, (o) => ({
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: !P(V(t, { _parent: o._id })),
267
+ droppable: !H(A(t, { _parent: o._id })),
288
268
  data: o
289
- })), _ = () => {
290
- r([]), c([]);
291
- }, [{ isOver: j }, E] = ue(() => ({
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: M } = ge((o) => ({
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: I(
290
+ onClick: () => N(),
291
+ className: D(
312
292
  "-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",
313
- M ? "bg-green-50/80" : "bg-background"
293
+ R ? "bg-green-50/80" : "bg-background"
314
294
  ),
315
- children: F(t) ? /* @__PURE__ */ e.jsxs(
295
+ children: L(t) ? /* @__PURE__ */ e.jsxs(
316
296
  "div",
317
297
  {
318
- ref: E,
319
- className: `mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${j ? "bg-blue-200" : ""}`,
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
- j ? /* @__PURE__ */ e.jsx(me, { className: "mx-auto h-12 w-12 animate-bounce" }) : /* @__PURE__ */ e.jsx(pe, { className: "mx-auto h-10 w-10" }),
322
- /* @__PURE__ */ e.jsx("p", { className: "mt-2", children: u(j ? "drop_here_message" : "tree_view_no_blocks") })
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.jsxs(Oe, { id: "layers-view", className: "no-scrollbar h-full overflow-y-auto p-1", children: [
326
- /* @__PURE__ */ e.jsx(We, {}),
327
- /* @__PURE__ */ e.jsx(
328
- he,
329
- {
330
- initialOpen: g,
331
- extraAcceptTypes: ["CHAI_BLOCK"],
332
- tree: i,
333
- rootId: 0,
334
- render: (o, { depth: l, isOpen: h, onToggle: b }) => /* @__PURE__ */ e.jsx(Ue, { id: o.id, children: /* @__PURE__ */ e.jsx(
335
- Fe,
336
- {
337
- onSelect: (f) => {
338
- c([]), r([f]);
339
- },
340
- isSelected: T(n, o.id),
341
- node: o,
342
- depth: l,
343
- isOpen: h,
344
- onToggle: b,
345
- toggleIds: a
346
- }
347
- ) }),
348
- dragPreviewRender: (o) => /* @__PURE__ */ e.jsx(ze, { monitorProps: o }),
349
- onDrop: m,
350
- classes: {
351
- root: "h-[90%] " + (d ? "pl-2" : "pt-2"),
352
- draggingSource: "opacity-30",
353
- dropTarget: "bg-green-100",
354
- placeholder: "relative"
355
- },
356
- sort: !1,
357
- insertDroppableFirst: !1,
358
- canDrop: Re,
359
- dropTargetOffset: 2,
360
- enableAnimateExpand: !0,
361
- placeholderRender: (o, { depth: l }) => /* @__PURE__ */ e.jsx(Ke, { node: o, depth: l })
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
- Yt as default
346
+ Wt as default
370
347
  };
@@ -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-TBa4RPnS.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-bfKqnRvZ.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-ueEpfep_.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-voX6SLpK.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
+ "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-DT71IahS.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-myA0a2nW.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-z9Kn4i1K.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,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-DXznIJrr.js";
4
+ import { a as l, b as c } from "./index-rktN6W1Y.js";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
6
  import "i18next";
7
7
  import "react-i18next";
8
- import "./index-m9VziIOy.js";
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-iYgzDs08.js")), g = i.lazy(() => import("./page-viewer-Hgr72mrQ.js")), gt = () => {
54
+ const x = i.lazy(() => import("./add-page-modal-pc5-Yw4C.js")), g = i.lazy(() => import("./page-viewer-Cv_WZY-t.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"),r=require("react"),x=require("lodash-es"),s=require("./index-bfKqnRvZ.cjs"),a=require("./index-TBa4RPnS.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-VFFXhGpN.cjs"))),m=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-aRDdqu88.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;
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-DT71IahS.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-ZiLidijs.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;
@@ -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-m9VziIOy.js";
5
- import { c as h, b as g } from "./index-DXznIJrr.js";
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-rktN6W1Y.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-OdZj-lfx.js")), S = m.lazy(() => import("./project-seo-setting-9V67NFil.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) ? {
54
+ const N = m.lazy(() => import("./project-general-setting-x6qqF0T8.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;