@chaibuilder/sdk 1.2.7 → 1.2.8

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 (91) hide show
  1. package/dist/{AddBlocks-pjLrzkvz.js → AddBlocks-tMxKPoen.js} +7 -6
  2. package/dist/AddBlocks-x2LkOHSj.cjs +1 -0
  3. package/dist/BrandingOptions-EzT9UYd6.cjs +1 -0
  4. package/dist/{BrandingOptions-PXCI0z-H.js → BrandingOptions-QJJ1y5ez.js} +7 -6
  5. package/dist/{CanvasArea-Fhg-6_nZ.js → CanvasArea-EfZgx-gN.js} +11 -9
  6. package/dist/{CanvasArea-C2ak1ui1.cjs → CanvasArea-rIDwPHl5.cjs} +1 -1
  7. package/dist/CurrentPage-QNFPD078.cjs +1 -0
  8. package/dist/{CurrentPage-Zz9LEdez.js → CurrentPage-ulHTz4MD.js} +14 -12
  9. package/dist/Functions-7jnEwJyw.js +15 -0
  10. package/dist/Functions-N3yhPYKY.cjs +1 -0
  11. package/dist/{Layers-cgmxKAP9.js → Layers-rehZkz78.js} +12 -10
  12. package/dist/Layers-v-7k3W2I.cjs +1 -0
  13. package/dist/{MarkAsGlobalBlock-htrpRVJM.js → MarkAsGlobalBlock-BjP-Rqlf.js} +6 -5
  14. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +1 -0
  15. package/dist/{PagesPanel-TYBKN2Am.js → PagesPanel-acGVGJf-.js} +9 -7
  16. package/dist/PagesPanel-x5ms_LOD.cjs +1 -0
  17. package/dist/ProjectPanel-5BHQ5ANP.cjs +1 -0
  18. package/dist/{ProjectPanel-PJ1iPaLY.js → ProjectPanel-aLFJq49M.js} +16 -14
  19. package/dist/Settings-iOjfw5NQ.cjs +1 -0
  20. package/dist/{Settings-Na0NVS-E.js → Settings-v-txwlII.js} +10 -9
  21. package/dist/{SidePanels-bHll6xCt.js → SidePanels-Vdc-J5wK.js} +12 -10
  22. package/dist/SidePanels-t0g9ZQFT.cjs +1 -0
  23. package/dist/Topbar-V8xCetWF.cjs +1 -0
  24. package/dist/{Topbar-JKdXHH8P.js → Topbar-j4t4AgCq.js} +6 -5
  25. package/dist/{UnsplashImages-jiOES16m.js → UnsplashImages-41Y3q5_Q.js} +6 -5
  26. package/dist/UnsplashImages-DbHky6cj.cjs +1 -0
  27. package/dist/UploadImages-DnQ95_NW.cjs +1 -0
  28. package/dist/{UploadImages-imersU7l.js → UploadImages-xBg-kbKv.js} +15 -14
  29. package/dist/add-page-modal-0YAI9dXr.cjs +1 -0
  30. package/dist/{add-page-modal-EQWWxbry.js → add-page-modal-6DlGzdA4.js} +10 -9
  31. package/dist/confirm-alert-U7-NcG7G.cjs +1 -0
  32. package/dist/{confirm-alert-HOs52FKE.js → confirm-alert-i4pM3mOt.js} +6 -5
  33. package/dist/{controls-hpe3HxsR.cjs → controls-Dy1qa8Dc.cjs} +1 -1
  34. package/dist/{controls-QGClapUl.js → controls-XPXGHKht.js} +45 -9
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.js +57 -55
  37. package/dist/{delete-page-modal-DU388lPm.js → delete-page-modal-T_rlQfNd.js} +22 -20
  38. package/dist/delete-page-modal-qXpi_2xR.cjs +1 -0
  39. package/dist/email-blocks.cjs +1 -1
  40. package/dist/email-blocks.js +1 -1
  41. package/dist/{form-7E1GY3U7.js → form-OVmsLOrc.js} +1 -1
  42. package/dist/{form-lF5eSfMe.cjs → form-VbouZlAW.cjs} +1 -1
  43. package/dist/html-to-json-2PeOCVey.cjs +1 -0
  44. package/dist/{html-to-json-lNLC8Y7D.js → html-to-json-57841sEK.js} +1 -1
  45. package/dist/{index-7vwIQQ-T.js → index-EGUphg4R.js} +5 -5
  46. package/dist/index-H6vIwGfD.cjs +1 -0
  47. package/dist/{index-Hf23Fq9m.cjs → index-jw8RxsTv.cjs} +2 -2
  48. package/dist/{index-WKIG_VPl.js → index-niHREMmR.js} +173 -172
  49. package/dist/lib.cjs +2 -2
  50. package/dist/lib.js +7 -6
  51. package/dist/{page-viewer-fohh_Dwv.js → page-viewer-EoYYnA56.js} +10 -8
  52. package/dist/page-viewer-Ou8vDXGV.cjs +1 -0
  53. package/dist/project-general-setting-92q4oEYv.cjs +1 -0
  54. package/dist/{project-general-setting-Ryf5OhPd.js → project-general-setting-DC_nADG-.js} +10 -9
  55. package/dist/project-seo-setting-Snn2nZgS.cjs +1 -0
  56. package/dist/{project-seo-setting-KKOCl416.js → project-seo-setting-wxAGEkd_.js} +11 -10
  57. package/dist/single-page-detail-QmmhR_h2.cjs +1 -0
  58. package/dist/{single-page-detail-mJBo7VRe.js → single-page-detail-xtNZ9YxX.js} +11 -10
  59. package/dist/studio.cjs +1 -1
  60. package/dist/studio.js +8 -6
  61. package/dist/ui.cjs +1 -1
  62. package/dist/ui.js +141 -140
  63. package/dist/{useAddBlockByDrop-CmSt8dRr.js → useAddBlockByDrop-_nwI4W3q.js} +1 -1
  64. package/dist/{useAddBlockByDrop-pVcDjcgp.cjs → useAddBlockByDrop-inkD7Lck.cjs} +1 -1
  65. package/dist/{utils-Jw11nj1S.js → utils-AvyFzbPC.js} +26 -35
  66. package/dist/utils-PTxFk6qT.cjs +1 -0
  67. package/dist/web-blocks.cjs +9 -1
  68. package/dist/web-blocks.js +1048 -3
  69. package/package.json +1 -1
  70. package/dist/AddBlocks-MKhgtI8x.cjs +0 -1
  71. package/dist/BrandingOptions-tZaUILYP.cjs +0 -1
  72. package/dist/CurrentPage-4O-iqW3w.cjs +0 -1
  73. package/dist/Layers-uo4KpGCs.cjs +0 -1
  74. package/dist/MarkAsGlobalBlock-1kOwPbPm.cjs +0 -1
  75. package/dist/PagesPanel-z5qHpU24.cjs +0 -1
  76. package/dist/ProjectPanel-mEVh8sLb.cjs +0 -1
  77. package/dist/Settings-YNxmjfAl.cjs +0 -1
  78. package/dist/SidePanels-jsHvSEtM.cjs +0 -1
  79. package/dist/Topbar-jWRuTvxv.cjs +0 -1
  80. package/dist/UnsplashImages-dBdqJNux.cjs +0 -1
  81. package/dist/UploadImages-OD3RPS7j.cjs +0 -1
  82. package/dist/add-page-modal-nFQ8TUBM.cjs +0 -1
  83. package/dist/confirm-alert-j6hcFSlG.cjs +0 -1
  84. package/dist/delete-page-modal-bkSWhTxz.cjs +0 -1
  85. package/dist/html-to-json-JS8zQjYB.cjs +0 -1
  86. package/dist/index-98CxilGX.cjs +0 -1
  87. package/dist/page-viewer-6a4GFMUg.cjs +0 -1
  88. package/dist/project-general-setting-j4lKlLUE.cjs +0 -1
  89. package/dist/project-seo-setting-CATo4bEL.cjs +0 -1
  90. package/dist/single-page-detail-zms-5Fa_.cjs +0 -1
  91. package/dist/utils-j7Kg63NR.cjs +0 -1
@@ -3,20 +3,20 @@ import B, { createElement as U, useState as b, useCallback as W, useMemo as J, u
3
3
  import { has as D, first as u, omit as Q, isEmpty as j, filter as v, values as y, groupBy as N, mergeWith as X, isArray as L, keys as Y, get as Z, map as A, includes as _, find as H, uniq as ee, reject as F } from "lodash-es";
4
4
  import { useAtom as k } from "jotai";
5
5
  import { useTranslation as G } from "react-i18next";
6
- import { P, j as w, $ as se, aw as S, aD as re, aE as te, aG as oe, i as z, a9 as M, ar as le, as as ae, at as ie, au as ne, av as E, bo as ce, bp as de, bq as me, br as pe, aI as ue, bs as xe, bt as he, B as fe, bu as ge, bv as be, bw as je, af as ve, ax as ye, ay as Be, az as C, bn as ke, bg as we, bh as Te, bi as Ce, bj as Ne, S as Ae } from "./index-WKIG_VPl.js";
6
+ import { P, j as w, $ as se, aw as S, aD as re, aE as te, aG as oe, i as z, a9 as M, ar as le, as as ae, at as ie, au as ne, av as E, bo as ce, bp as de, bq as me, br as pe, aI as ue, bs as xe, bt as he, B as fe, bu as ge, bv as be, bw as je, af as ve, ax as ye, ay as Be, az as C, bn as ke, bg as we, bh as Te, bi as Ce, bj as Ne, S as Ae } from "./index-niHREMmR.js";
7
7
  import { BoxIcon as _e } from "@radix-ui/react-icons";
8
8
  import { syncBlocksWithDefaults as q, useChaiBlocks as V } from "@chaibuilder/runtime";
9
9
  import { useFeature as Pe } from "flagged";
10
10
  import { Loader as Se } from "lucide-react";
11
11
  import { useDrag as Ie, DragPreviewImage as Le } from "react-dnd";
12
- import { g as He } from "./html-to-json-lNLC8Y7D.js";
12
+ import { g as He } from "./html-to-json-57841sEK.js";
13
13
  import "./_commonjsHelpers-UyOWmZb0.js";
14
14
  import "@radix-ui/react-toggle";
15
15
  import "class-variance-authority";
16
- import "./utils-Jw11nj1S.js";
16
+ import "./utils-AvyFzbPC.js";
17
+ import "./MODIFIERS-RiXS5Mn1.js";
17
18
  import "clsx";
18
19
  import "tailwind-merge";
19
- import "./MODIFIERS-RiXS5Mn1.js";
20
20
  import "@radix-ui/react-switch";
21
21
  import "@radix-ui/react-slot";
22
22
  import "@radix-ui/react-accordion";
@@ -39,6 +39,7 @@ import "react-icons-picker";
39
39
  import "react-dom";
40
40
  import "react-quill";
41
41
  import "flat-to-nested";
42
+ import "./Functions-7jnEwJyw.js";
42
43
  import "redux-undo";
43
44
  import "lodash";
44
45
  import "@react-hookz/web";
@@ -173,7 +174,7 @@ const Fe = ({ block: s }) => {
173
174
  return !_(R, r);
174
175
  const t = s._type;
175
176
  return t === "List" ? r === "ListItem" : t === "Table" ? r === "TableHead" || r === "TableBody" : t === "TableHead" || t === "TableBody" ? r === "TableRow" : t === "TableRow" ? r === "TableCell" : t === "Row" ? r === "Column" : t === "Heading" || t === "Text" ? r === "RawText" : !_(R, r);
176
- }, Ss = () => {
177
+ }, Is = () => {
177
178
  const { t: s } = G(), [r, t] = b("core"), [l, d] = b("basic"), n = V(), [, m] = k(je), o = z("importHTMLSupport", !0), [x] = w(), p = ve(), i = H(p, { _id: u(x) }), { data: a, isLoading: f } = M(), h = N(
178
179
  v(n, (c) => Ge(i, c.type)),
179
180
  "category"
@@ -220,5 +221,5 @@ const Fe = ({ block: s }) => {
220
221
  ] });
221
222
  };
222
223
  export {
223
- Ss as default
224
+ Is as default
224
225
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),t=require("lodash-es"),R=require("jotai"),q=require("react-i18next"),s=require("./index-H6vIwGfD.cjs"),C=require("@radix-ui/react-icons"),b=require("@chaibuilder/runtime"),w=require("flagged"),N=require("lucide-react"),B=require("react-dnd"),A=require("./html-to-json-2PeOCVey.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("lodash");require("@react-hookz/web");require("himalaya");const S=({block:r})=>{const{type:o,icon:i,label:n}=r,{addCoreBlock:m,addPredefinedBlock:d}=s.useAddBlock(),[p,l]=s.useSelectedBlockIds(),[,h]=s.useHighlightBlockId(),[,j]=R.useAtom(s.activePanelAtom),u=()=>{t.has(r,"blocks")?d(b.syncBlocksWithDefaults(r.blocks),t.first(p)):m(r,t.first(p)),j("layers")},c=w.useFeature("dnd");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:u,type:"button",onDragStart:g=>{g.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{l([]),h(null),j("layers")},200)},draggable:c?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(c?"cursor-grab":"cursor-pointer"),children:[a.createElement(i||C.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"truncate text-xs",children:n||o})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:n||o})})]})})},I=({block:r,closePopover:o})=>{var c;const[i,n]=a.useState(!1),m=s.useBuilderProp("getExternalPredefinedBlock"),{addCoreBlock:d,addPredefinedBlock:p}=s.useAddBlock(),[l]=s.useSelectedBlockIds(),[,h,j]=B.useDrag(()=>({type:"CHAI_BLOCK",item:r}),[r]),u=a.useCallback(async g=>{if(g.stopPropagation(),t.has(r,"component")){d(r,t.first(l)),o();return}n(!0);const f=await m(r);t.isEmpty(f)||p(b.syncBlocksWithDefaults(f),t.first(l)),o()},[r]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(B.DragPreviewImage,{connect:j,src:"https://placehold.co/100x30/000000/FFF?text="+((c=r.name||r.label)==null?void 0:c.replace(" ","+"))}),e.jsxRuntimeExports.jsxs("div",{ref:h,onClick:i?()=>{}:u,className:"relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[i&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(N.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:r.label}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:r.label})})]})]})},P=()=>{const{data:r}=s.useUILibraryBlocks(),o=b.useChaiBlocks(),i=t.filter(t.values(o),{category:"custom"}),n=t.groupBy(i,"group"),m=t.groupBy(r,"group"),d=a.useMemo(()=>t.mergeWith(n,m,(u,c)=>{if(t.isArray(u)&&t.isArray(c))return[...u,...c]}),[n,m]),[p,l]=a.useState(t.first(t.keys(d))||""),[,h]=R.useAtom(s.activePanelAtom),j=t.get(d,p,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col h-full max-h-full overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("div",{className:"p-3 sticky top-0 flex w-full items-center",children:e.jsxRuntimeExports.jsxs(s.Select,{value:p,onValueChange:u=>l(u),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:"Choose"}),a.Children.toArray(t.map(d,(u,c)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:c,children:c},c)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:a.Children.toArray(j.map(u=>e.jsxRuntimeExports.jsx(I,{block:u,closePopover:()=>h("layers")})))})]})},_=()=>{const{t:r}=q.useTranslation(),[o,i]=a.useState(""),{addPredefinedBlock:n}=s.useAddBlock(),[m]=s.useSelectedBlockIds(),[,d]=R.useAtom(s.activePanelAtom),p=()=>{const l=A.getBlocksFromHTML(o);n([...l],t.first(m)||null),i(""),d("layers")};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:l=>l&&l.focus(),onChange:l=>i(l.target.value),rows:12,value:o,placeholder:r("enter_code_snippet"),className:"resize-none bg-gray-100 overflow-x-auto whitespace-pre text-xs font-mono font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:o.trim()==="",onClick:()=>p(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 p-1 border-none text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},k=["ListItem","TableHead","TableBody","TableRow","TableCell","Column"],L=(r,o)=>{if(!r)return!t.includes(k,o);const i=r._type;return i==="List"?o==="ListItem":i==="Table"?o==="TableHead"||o==="TableBody":i==="TableHead"||i==="TableBody"?o==="TableRow":i==="TableRow"?o==="TableCell":i==="Row"?o==="Column":i==="Heading"||i==="Text"?o==="RawText":!t.includes(k,o)},H=()=>{const{t:r}=q.useTranslation(),[o,i]=a.useState("core"),[n,m]=a.useState("basic"),d=b.useChaiBlocks(),[,p]=R.useAtom(s.showPredefinedBlockCategoryAtom),l=s.useBuilderProp("importHTMLSupport",!0),[h]=s.useSelectedBlockIds(),j=s.useAllBlocks(),u=t.find(j,{_id:t.first(h)}),{data:c,isLoading:g}=s.useUILibraryBlocks(),f=t.groupBy(t.filter(d,x=>L(u,x.type)),"category"),E=t.uniq(t.map(f.core,"group"));a.useEffect(()=>{!t.includes(E,n)&&!t.isEmpty(E)&&!t.isEmpty(n)&&m(t.first(E))},[E,n]);const T=x=>m(y=>y===x?"":x),v=!g&&!t.isEmpty(c)||t.find(t.values(d),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:r("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r(o==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:x=>{p(""),i(x)},value:o,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(v&&l?"grid-cols-3":"grid-cols-2"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("core")}),v?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:r("custom_blocks")}):null,l?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),o==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:n,className:"w-full px-3",children:a.Children.toArray(t.map(E,x=>t.reject(t.filter(t.values(f.core),{group:x}),{hidden:!0}).length?e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:x,className:"border-border",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{onClick:()=>T(x),className:"py-2 capitalize",children:x}),e.jsxRuntimeExports.jsx(s.AccordionContent,{children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:a.Children.toArray(t.reject(t.filter(t.values(f.core),{group:x}),{hidden:!0}).map(y=>e.jsxRuntimeExports.jsx(S,{block:y})))})})]}):null))})}),o==="ui-blocks"&&e.jsxRuntimeExports.jsx(a.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(P,{})}),o==="html"&&l?e.jsxRuntimeExports.jsx(_,{}):null]})};exports.default=H;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),B=require("react"),R=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./index-H6vIwGfD.cjs"),r=require("./controls-Dy1qa8Dc.cjs"),m=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");function N(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const x=N(B),k=({value:t,onChange:e,id:i,onBlur:l})=>{const n=m.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},f=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],P=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",async()=>{}),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=x.useRef(e);x.useEffect(()=>()=>{m.isEqual(e,n.current)||t(n.current)},[]);const v=({formData:o},d)=>{d&&(i(o),n.current=o)},{bodyFont:u,headingFont:q,primaryColor:y,bodyTextDarkColor:b,bodyTextLightColor:h,bodyBgDarkColor:S,secondaryColor:C,bodyBgLightColor:O,roundedCorners:j}=e;let s={headingFont:r.f({title:"Heading font",default:q,options:f}),bodyFont:r.f({title:"Body font",default:u,options:f}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(j||5,10)}),primaryColor:r.y({title:"Primary",default:y}),secondaryColor:r.y({title:"Secondary",default:C})};l||(s={...s,bodyBgLightColor:r.y({title:"Body Background (Light)",default:O}),bodyBgDarkColor:r.y({title:"Body Background (Dark)",default:S}),bodyTextLightColor:r.y({title:"Body Text (Light)",default:b}),bodyTextDarkColor:r.y({title:"Body Text (Dark)",default:h})});const c={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const d=s[o];return c.properties||(c.properties={}),c.properties[o]=d.schema,g[o]=d.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:k},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:c,formData:e,validator:R,onChange:v})})]})};exports.default=P;
@@ -2,16 +2,16 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as c from "react";
3
3
  import N from "@rjsf/validator-ajv8";
4
4
  import j from "@rjsf/core";
5
- import { i as k, x as D, y as P } from "./index-WKIG_VPl.js";
6
- import { f, c as R, y as a } from "./controls-QGClapUl.js";
5
+ import { i as k, x as D, y as P } from "./index-niHREMmR.js";
6
+ import { f, c as R, y as a } from "./controls-XPXGHKht.js";
7
7
  import { debounce as w, isEqual as L } from "lodash-es";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
9
9
  import "@radix-ui/react-toggle";
10
10
  import "class-variance-authority";
11
- import "./utils-Jw11nj1S.js";
11
+ import "./utils-AvyFzbPC.js";
12
+ import "./MODIFIERS-RiXS5Mn1.js";
12
13
  import "clsx";
13
14
  import "tailwind-merge";
14
- import "./MODIFIERS-RiXS5Mn1.js";
15
15
  import "@radix-ui/react-switch";
16
16
  import "@radix-ui/react-slot";
17
17
  import "@radix-ui/react-accordion";
@@ -36,6 +36,7 @@ import "react-dom";
36
36
  import "react-quill";
37
37
  import "jotai";
38
38
  import "flat-to-nested";
39
+ import "./Functions-7jnEwJyw.js";
39
40
  import "redux-undo";
40
41
  import "@chaibuilder/runtime";
41
42
  import "lodash";
@@ -103,7 +104,7 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
103
104
  { title: "Lustria", value: "Lustria" },
104
105
  { title: "Ovo", value: "Ovo" },
105
106
  { title: "Suranna", value: "Suranna" }
106
- ], St = () => {
107
+ ], Bt = () => {
107
108
  const u = k("onSaveBrandingOptions", async () => {
108
109
  }), [e, p] = D(), [d] = P(), i = c.useRef(e);
109
110
  c.useEffect(() => () => {
@@ -189,5 +190,5 @@ const F = ({ value: u, onChange: e, id: p, onBlur: d }) => {
189
190
  ] });
190
191
  };
191
192
  export {
192
- St as default
193
+ Bt as default
193
194
  };
@@ -5,14 +5,14 @@ import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
5
  import V, { createElement as be, useCallback as je, useState as q, useEffect as M, Component as Ke, Children as Ct, Suspense as Je, useRef as Oe, useMemo as It } from "react";
6
6
  import { map as re, includes as Ae, toUpper as pe, round as Et, throttle as Ve, noop as te, isEmpty as K, first as ae, omit as St, pick as Dt, get as D, isString as Te, memoize as Bt, each as _t, find as Ot, filter as Xe, isNull as At } from "lodash-es";
7
7
  import { ResetIcon as Pe, MobileIcon as Re, LaptopIcon as Pt, DesktopIcon as Rt, DotsVerticalIcon as Mt, EraserIcon as Lt, ZoomInIcon as Nt, DragHandleDots2Icon as Ft, ArrowUpIcon as $t, CopyIcon as Wt, TrashIcon as Ht } from "@radix-ui/react-icons";
8
- import { p as Ce, B as le, X as Ze, aI as qt, aJ as Ut, aK as zt, aL as Yt, aM as Kt, U as Ie, aj as Jt, i as Ee, aN as Vt, aO as Xt, aP as Zt, aQ as Qt, aR as Gt, aS as en, w as tn, j as U, ak as X, E as nn, F as rn, G as on, H as sn, I as an, J as ln, K as cn, L as dn, aq as un, M as pn, V as Qe, aH as ie, aT as fn, $ as Q, ac as hn, aU as G, af as Se, m as Ge, n as gn, k as mn, o as yn, h as et, l as tt, ah as vn, aV as xn, aW as nt, aX as bn, aY as kn, x as wn, aZ as jn, a7 as Tn, a_ as Cn, S as rt } from "./index-WKIG_VPl.js";
8
+ import { p as Ce, B as le, X as Ze, aI as qt, aJ as Ut, aK as zt, aL as Yt, aM as Kt, U as Ie, aj as Jt, i as Ee, aN as Vt, aO as Xt, aP as Zt, aQ as Qt, aR as Gt, aS as en, w as tn, j as U, ak as X, E as nn, F as rn, G as on, H as sn, I as an, J as ln, K as cn, L as dn, aq as un, M as pn, V as Qe, aH as ie, aT as fn, $ as Q, ac as hn, aU as G, af as Se, m as Ge, n as gn, k as mn, o as yn, h as et, l as tt, ah as vn, aV as xn, aW as nt, aX as bn, aY as kn, x as wn, aZ as jn, a7 as Tn, a_ as Cn, S as rt } from "./index-niHREMmR.js";
9
9
  import { useTranslation as de } from "react-i18next";
10
10
  import { useAtom as N } from "jotai";
11
11
  import Me from "react-dom";
12
12
  import { g as In } from "./_commonjsHelpers-UyOWmZb0.js";
13
- import { r as ot, u as En, B as Sn, E as Dn } from "./index-7vwIQQ-T.js";
13
+ import { r as ot, u as En, B as Sn, E as Dn } from "./index-EGUphg4R.js";
14
14
  import { Quill as Bn } from "react-quill";
15
- import { u as _n } from "./useAddBlockByDrop-CmSt8dRr.js";
15
+ import { u as _n } from "./useAddBlockByDrop-_nwI4W3q.js";
16
16
  import { useFeature as st } from "flagged";
17
17
  import { flip as On } from "@floating-ui/dom";
18
18
  import { useFloating as An, shift as Pn } from "@floating-ui/react-dom";
@@ -25,7 +25,7 @@ import { getBlockComponent as at } from "@chaibuilder/runtime";
25
25
  import { has as Fn } from "lodash";
26
26
  import "@radix-ui/react-toggle";
27
27
  import "class-variance-authority";
28
- import "./utils-Jw11nj1S.js";
28
+ import "./utils-AvyFzbPC.js";
29
29
  import "clsx";
30
30
  import "@radix-ui/react-switch";
31
31
  import "@radix-ui/react-slot";
@@ -47,6 +47,7 @@ import "cmdk";
47
47
  import "@radix-ui/react-context-menu";
48
48
  import "react-icons-picker";
49
49
  import "flat-to-nested";
50
+ import "./Functions-7jnEwJyw.js";
50
51
  import "redux-undo";
51
52
  import "i18next";
52
53
  import "react-textarea-autosize";
@@ -54,10 +55,11 @@ import "react-dnd";
54
55
  import "@minoru/react-dnd-treeview";
55
56
  import "react-hotkeys-hook";
56
57
  import "sonner";
57
- import "./html-to-json-lNLC8Y7D.js";
58
+ import "./html-to-json-57841sEK.js";
58
59
  import "himalaya";
59
60
  import "lucide-react";
60
61
  import "./web-blocks.js";
62
+ import "./controls-XPXGHKht.js";
61
63
  const $n = () => {
62
64
  const { undoCount: e, redoCount: t, undo: n, redo: s } = Ce();
63
65
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
@@ -818,7 +820,7 @@ function Zn() {
818
820
  return l.PropTypes = l, l;
819
821
  }, ve;
820
822
  }
821
- var _o = ce.exports;
823
+ var Ao = ce.exports;
822
824
  if (process.env.NODE_ENV !== "production") {
823
825
  var Qn = ot, Gn = !0;
824
826
  ce.exports = Xn()(Qn.isElement, Gn);
@@ -829,7 +831,7 @@ const R = /* @__PURE__ */ In(er);
829
831
  let ct, dt;
830
832
  typeof document < "u" && (ct = document);
831
833
  typeof window < "u" && (dt = window);
832
- const ut = V.createContext({ document: ct, window: dt }), ue = () => V.useContext(ut), { Provider: tr, Consumer: Oo } = ut;
834
+ const ut = V.createContext({ document: ct, window: dt }), ue = () => V.useContext(ut), { Provider: tr, Consumer: Po } = ut;
833
835
  class pt extends Ke {
834
836
  componentDidMount() {
835
837
  this.props.contentDidMount();
@@ -1414,10 +1416,10 @@ const jr = () => {
1414
1416
  )
1415
1417
  }
1416
1418
  );
1417
- }, Ao = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1419
+ }, Ro = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1418
1420
  /* @__PURE__ */ r.jsx(zn, {}),
1419
1421
  /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(Je, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Dn, { children: /* @__PURE__ */ r.jsx(Cr, {}) }) }) })
1420
1422
  ] });
1421
1423
  export {
1422
- Ao as default
1424
+ Ro as default
1423
1425
  };
@@ -1,4 +1,4 @@
1
- "use strict";var Ue=Object.defineProperty;var ze=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>(ze(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),p=require("lodash-es"),L=require("@radix-ui/react-icons"),o=require("./index-98CxilGX.cjs"),ne=require("react-i18next"),H=require("jotai"),ge=require("react-dom"),Ye=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-Hf23Fq9m.cjs"),Ke=require("react-quill"),Je=require("./useAddBlockByDrop-pVcDjcgp.cjs"),Ce=require("flagged"),Ve=require("@floating-ui/dom"),me=require("@floating-ui/react-dom"),Ze=require("@react-hookz/web"),Qe=require("@bobthered/tailwindcss-palette-generator"),Ge=require("react-wrap-balancer"),Xe=require("tailwind-merge"),ee=require("./MODIFIERS-2FeVfZQ9.cjs"),Te=require("@chaibuilder/runtime"),et=require("lodash");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-j7Kg63NR.cjs");require("clsx");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("flat-to-nested");require("redux-undo");require("i18next");require("react-textarea-autosize");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-JS8zQjYB.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");const tt=()=>{const{undoCount:e,redoCount:t,undo:n,redo:i}=o.useCanvasHistory();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Button,{disabled:!e,size:"sm",onClick:n,className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{})}),s.jsxRuntimeExports.jsx(o.Button,{disabled:!t,onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function nt(){const[e,t]=o.useDarkMode(),{t:n}=ne.useTranslation();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Label,{htmlFor:"dark-mode-switch",children:n("dark_mode")}),s.jsxRuntimeExports.jsxs(o.Switch,{id:"dark-mode-switch",checked:e,onCheckedChange:()=>{t(!e)},className:`${e?"bg-violet-600":"bg-violet-300"}
1
+ "use strict";var Ue=Object.defineProperty;var ze=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>(ze(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),p=require("lodash-es"),L=require("@radix-ui/react-icons"),o=require("./index-H6vIwGfD.cjs"),ne=require("react-i18next"),H=require("jotai"),ge=require("react-dom"),Ye=require("./_commonjsHelpers-wDK0ZLPo.cjs"),G=require("./index-jw8RxsTv.cjs"),Ke=require("react-quill"),Je=require("./useAddBlockByDrop-inkD7Lck.cjs"),Ce=require("flagged"),Ve=require("@floating-ui/dom"),me=require("@floating-ui/react-dom"),Ze=require("@react-hookz/web"),Qe=require("@bobthered/tailwindcss-palette-generator"),Ge=require("react-wrap-balancer"),Xe=require("tailwind-merge"),ee=require("./MODIFIERS-2FeVfZQ9.cjs"),Te=require("@chaibuilder/runtime"),et=require("lodash");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("clsx");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("i18next");require("react-textarea-autosize");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const tt=()=>{const{undoCount:e,redoCount:t,undo:n,redo:i}=o.useCanvasHistory();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Button,{disabled:!e,size:"sm",onClick:n,className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{})}),s.jsxRuntimeExports.jsx(o.Button,{disabled:!t,onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(L.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function nt(){const[e,t]=o.useDarkMode(),{t:n}=ne.useTranslation();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Label,{htmlFor:"dark-mode-switch",children:n("dark_mode")}),s.jsxRuntimeExports.jsxs(o.Switch,{id:"dark-mode-switch",checked:e,onCheckedChange:()=>{t(!e)},className:`${e?"bg-violet-600":"bg-violet-300"}
2
2
  relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[s.jsxRuntimeExports.jsx("span",{className:"sr-only",children:n("use_setting")}),s.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${e?"translate-x-5":"translate-x-0"}
3
3
  pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const ye=({landscape:e=!1})=>s.jsxRuntimeExports.jsxs("svg",{className:e?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[s.jsxRuntimeExports.jsx("g",{strokeWidth:0}),s.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),s.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),st=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:s.jsxRuntimeExports.jsx(L.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:s.jsxRuntimeExports.jsx(L.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:s.jsxRuntimeExports.jsx(ye,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:s.jsxRuntimeExports.jsx(ye,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:s.jsxRuntimeExports.jsx(L.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:s.jsxRuntimeExports.jsx(L.DesktopIcon,{}),width:1920}],ve=({title:e,content:t,currentBreakpoint:n,breakpoint:i,width:a,icon:c,onClick:u})=>{const{t:r}=ne.useTranslation();return s.jsxRuntimeExports.jsxs(o.HoverCard,{children:[s.jsxRuntimeExports.jsx(o.HoverCardTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx(o.Button,{onClick:()=>u(a),size:"sm",variant:i===n?"secondary":"ghost",children:c})}),s.jsxRuntimeExports.jsx(o.HoverCardContent,{className:"w-52 border-border",children:s.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:s.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[s.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:r(e)}),s.jsxRuntimeExports.jsx("p",{className:"text-xs",children:r(t)})]})})})]})},rt=()=>{const[,e,t]=o.useCanvasWidth(),[n,i]=o.useSelectedBreakpoints(),{t:a}=ne.useTranslation(),c=o.useBuilderProp("breakpoints",st),u=r=>{n.includes(r)?n.length>2&&i(n.filter(d=>d!==r)):i(d=>[...d,r])};return c.length<4?s.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:p.map(c,r=>g.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e}))}):s.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[p.map(c.filter(r=>p.includes(n,p.toUpper(r.breakpoint))),r=>g.createElement(ve,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e})),s.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[s.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:s.jsxRuntimeExports.jsx(L.DotsVerticalIcon,{className:"scale-90 transform"})})}),s.jsxRuntimeExports.jsxs(o.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[s.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:a("Breakpoints")}),s.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),p.map(c,r=>s.jsxRuntimeExports.jsx(o.DropdownMenuCheckboxItem,{disabled:r.breakpoint==="xs",onCheckedChange:()=>u(p.toUpper(r.breakpoint)),checked:p.includes(n,p.toUpper(r.breakpoint)),children:a(r.title)},r.breakpoint))]})]})]})},ot=()=>{const{t:e}=ne.useTranslation(),[t]=o.useSetAllBlocks(),{createSnapshot:n}=o.useCanvasHistory(),[,i]=o.useSelectedBlockIds(),[,a]=o.useSelectedStylingBlocks(),c=g.useCallback(()=>{t([]),i([]),a([]),n()},[t,n]);return s.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:s.jsxRuntimeExports.jsxs(o.AlertDialog,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsxs(o.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[s.jsxRuntimeExports.jsx(L.EraserIcon,{})," ",e("clear")]})}),s.jsxRuntimeExports.jsxs(o.AlertDialogContent,{className:"border-border",children:[s.jsxRuntimeExports.jsxs(o.AlertDialogHeader,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTitle,{children:e("clear_canvas_title")}),s.jsxRuntimeExports.jsx(o.AlertDialogDescription,{children:e("clear_canvas_description")})]}),s.jsxRuntimeExports.jsxs(o.AlertDialogFooter,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogCancel,{children:e("cancel")}),s.jsxRuntimeExports.jsx(o.AlertDialogAction,{onClick:c,children:e("yes")})]})]})]})})},it=()=>{const e=o.useFeatureSupport("darkMode",!1),[t]=o.useCanvasZoom();return s.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[s.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[e?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(nt,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"})]}):null,s.jsxRuntimeExports.jsx(rt,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[s.jsxRuntimeExports.jsx(L.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",s.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[p.round(t,0),"%"]})]}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(tt,{})]}),s.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(ot,{})]})]})},at=`<!doctype html>
4
4
  <html class="scroll-smooth h-full overflow-y-auto">
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-H6vIwGfD.cjs"),i=require("lodash-es"),h=require("sonner"),l=require("react"),o=require("./index-jw8RxsTv.cjs"),j=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const p=()=>{const{data:s}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{syncState:q}=t.useSavePage(),d=o.useChangePage(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(s==null?void 0:s.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&s.homepage&&!i.find(u,{uuid:n})&&a(s.homepage)},[n,u,s,a]),l.useEffect(()=>()=>a(null),[a]);const m=r=>{if(q!=="SAVED")h.toast.error("You have unsaved changes. Please save before changing the page.");else{const g=i.find(c,{uuid:r});d(g)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 pr-0 py-1 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(j.BriefcaseIcon,{className:"w-4 h-4 mr-2"}),i.capitalize(s.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(t.Select,{value:n||"",onValueChange:m,children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(t.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=p;
@@ -1,17 +1,17 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { ah as x, ar as h, as as f, at as j, au as y, av as v } from "./index-WKIG_VPl.js";
2
+ import { ah as x, ar as h, as as f, at as j, au as y, av as v } from "./index-niHREMmR.js";
3
3
  import { sortBy as P, filter as b, get as w, isEmpty as m, find as n, capitalize as C, map as N } from "lodash-es";
4
4
  import { toast as S } from "sonner";
5
5
  import { useEffect as p } from "react";
6
- import { b as k, a as B, d as E, e as I } from "./index-7vwIQQ-T.js";
6
+ import { b as k, a as B, d as E, e as I } from "./index-EGUphg4R.js";
7
7
  import { BriefcaseIcon as L } from "lucide-react";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
9
9
  import "@radix-ui/react-toggle";
10
10
  import "class-variance-authority";
11
- import "./utils-Jw11nj1S.js";
11
+ import "./utils-AvyFzbPC.js";
12
+ import "./MODIFIERS-RiXS5Mn1.js";
12
13
  import "clsx";
13
14
  import "tailwind-merge";
14
- import "./MODIFIERS-RiXS5Mn1.js";
15
15
  import "@radix-ui/react-switch";
16
16
  import "@radix-ui/react-slot";
17
17
  import "@radix-ui/react-accordion";
@@ -36,6 +36,7 @@ import "react-dom";
36
36
  import "react-quill";
37
37
  import "jotai";
38
38
  import "flat-to-nested";
39
+ import "./Functions-7jnEwJyw.js";
39
40
  import "redux-undo";
40
41
  import "@chaibuilder/runtime";
41
42
  import "lodash";
@@ -48,14 +49,15 @@ import "flagged";
48
49
  import "react-dnd";
49
50
  import "@minoru/react-dnd-treeview";
50
51
  import "react-hotkeys-hook";
51
- import "./html-to-json-lNLC8Y7D.js";
52
+ import "./html-to-json-57841sEK.js";
52
53
  import "himalaya";
53
54
  import "./web-blocks.js";
54
- const Le = () => {
55
- const { data: t } = k(), { data: i, isLoading: l } = B(), { syncState: c } = x(), d = E(), [a, o] = I(), s = P(b(i, { type: "STATIC" }), (r) => w(r, "uuid") === (t == null ? void 0 : t.homepage) ? 0 : 1);
55
+ import "./controls-XPXGHKht.js";
56
+ const Ve = () => {
57
+ const { data: t } = k(), { data: i, isLoading: l } = B(), { syncState: c } = x(), d = E(), [o, a] = I(), s = P(b(i, { type: "STATIC" }), (r) => w(r, "uuid") === (t == null ? void 0 : t.homepage) ? 0 : 1);
56
58
  p(() => {
57
- !m(i) && t.homepage && !n(i, { uuid: a }) && o(t.homepage);
58
- }, [a, i, t, o]), p(() => () => o(null), [o]);
59
+ !m(i) && t.homepage && !n(i, { uuid: o }) && a(t.homepage);
60
+ }, [o, i, t, a]), p(() => () => a(null), [a]);
59
61
  const u = (r) => {
60
62
  if (c !== "SAVED")
61
63
  S.error("You have unsaved changes. Please save before changing the page.");
@@ -64,7 +66,7 @@ const Le = () => {
64
66
  d(g);
65
67
  }
66
68
  };
67
- return l || m(a) ? null : /* @__PURE__ */ e.jsx(
69
+ return l || m(o) ? null : /* @__PURE__ */ e.jsx(
68
70
  "nav",
69
71
  {
70
72
  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",
@@ -95,7 +97,7 @@ const Le = () => {
95
97
  )
96
98
  }
97
99
  ),
98
- /* @__PURE__ */ e.jsxs(h, { value: a || "", onValueChange: u, children: [
100
+ /* @__PURE__ */ e.jsxs(h, { value: o || "", onValueChange: u, children: [
99
101
  /* @__PURE__ */ e.jsx(f, { 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: /* @__PURE__ */ e.jsx(j, { placeholder: "Page" }) }),
100
102
  /* @__PURE__ */ e.jsx(y, { className: "z-[999]", children: N(s, (r) => /* @__PURE__ */ e.jsx(v, { value: r.uuid, children: r == null ? void 0 : r.name }, r.uuid)) })
101
103
  ] })
@@ -105,5 +107,5 @@ const Le = () => {
105
107
  );
106
108
  };
107
109
  export {
108
- Le as default
110
+ Ve as default
109
111
  };
@@ -0,0 +1,15 @@
1
+ import { isEmpty as s, startsWith as f } from "lodash-es";
2
+ import { clsx as n } from "clsx";
3
+ import { twMerge as a } from "tailwind-merge";
4
+ function c(t = 6, r = "abcdefghijklmnopqrstuvwxyzABCD") {
5
+ let e = "";
6
+ for (let o = t; o > 0; --o)
7
+ e += r[Math.floor(Math.random() * r.length)];
8
+ return e;
9
+ }
10
+ const l = (t) => t >= 1536 ? "2XL" : t >= 1280 ? "XL" : t >= 1024 ? "LG" : t >= 768 ? "MD" : t >= 640 ? "SM" : "XS", i = (...t) => a(n(t));
11
+ export {
12
+ l as a,
13
+ i as c,
14
+ c as g
15
+ };
@@ -0,0 +1 @@
1
+ "use strict";const u=require("lodash-es"),o=require("clsx"),s=require("tailwind-merge");function c(e=6,t="abcdefghijklmnopqrstuvwxyzABCD"){let r="";for(let n=e;n>0;--n)r+=t[Math.floor(Math.random()*t.length)];return r}const a=e=>e>=1536?"2XL":e>=1280?"XL":e>=1024?"LG":e>=768?"MD":e>=640?"SM":"XS",l=(...e)=>s.twMerge(o.clsx(e));exports.cn=l;exports.generateUUID=c;exports.getBreakpointValue=a;
@@ -4,16 +4,19 @@ import { BoxModelIcon as F, BoxIcon as D, DragHandleHorizontalIcon as $, ViewHor
4
4
  import { useDrop as be, useDragLayer as fe } from "react-dnd";
5
5
  import { useDragOver as Ie, Tree as ke } from "@minoru/react-dnd-treeview";
6
6
  import { useTranslation as ye } from "react-i18next";
7
- import { $ as Ce, _ as Be, j as x, n as ve, bx as i, k as we, l as Se, a7 as Te, m as De, o as Ne, i as Me, by as Oe, al as Re, am as _e, bz as Ee, bA as Ae, y as N, af as He, w as Pe, ak as Le, p as ze, bn as Ve, bB as Fe } from "./index-WKIG_VPl.js";
7
+ import { $ as Ce, _ as Be, j as x, n as ve, bx as i, k as we, l as Se, a7 as Te, m as De, o as Ne, i as Me, by as Oe, al as Re, am as _e, bz as Ee, bA as Ae, y as N, af as He, w as Pe, ak as Le, p as ze, bn as Ve, bB as Fe } from "./index-niHREMmR.js";
8
8
  import { DatabaseIcon as $e } from "lucide-react";
9
9
  import { useMemo as Ge, lazy as Ke, useCallback as Qe, useState as Ue, Suspense as Ye } from "react";
10
10
  import { a as qe } from "./MODIFIERS-RiXS5Mn1.js";
11
- import { d as k } from "./utils-Jw11nj1S.js";
12
- import { f as We } from "./index-7vwIQQ-T.js";
13
- import { u as Je } from "./useAddBlockByDrop-CmSt8dRr.js";
11
+ import { c as k } from "./Functions-7jnEwJyw.js";
12
+ import { f as We } from "./index-EGUphg4R.js";
13
+ import { u as Je } from "./useAddBlockByDrop-_nwI4W3q.js";
14
14
  import "./_commonjsHelpers-UyOWmZb0.js";
15
15
  import "@radix-ui/react-toggle";
16
16
  import "class-variance-authority";
17
+ import "./utils-AvyFzbPC.js";
18
+ import "clsx";
19
+ import "tailwind-merge";
17
20
  import "@radix-ui/react-switch";
18
21
  import "@radix-ui/react-slot";
19
22
  import "@radix-ui/react-accordion";
@@ -41,17 +44,16 @@ import "redux-undo";
41
44
  import "@chaibuilder/runtime";
42
45
  import "lodash";
43
46
  import "@react-hookz/web";
44
- import "clsx";
45
- import "tailwind-merge";
46
47
  import "i18next";
47
48
  import "@floating-ui/react-dom";
48
49
  import "react-textarea-autosize";
49
50
  import "flagged";
50
51
  import "react-hotkeys-hook";
51
52
  import "sonner";
52
- import "./html-to-json-lNLC8Y7D.js";
53
+ import "./html-to-json-57841sEK.js";
53
54
  import "himalaya";
54
55
  import "./web-blocks.js";
56
+ import "./controls-XPXGHKht.js";
55
57
  const M = (t) => {
56
58
  switch (t.type) {
57
59
  case "Image":
@@ -204,7 +206,7 @@ const Ze = (t) => {
204
206
  }, st = (t) => {
205
207
  const s = t.depth * 10 + 16;
206
208
  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
- }, ot = Ke(() => import("./MarkAsGlobalBlock-htrpRVJM.js")), nt = () => {
209
+ }, ot = Ke(() => import("./MarkAsGlobalBlock-BjP-Rqlf.js")), nt = () => {
208
210
  const [t] = x(), [, s] = ve();
209
211
  return /* @__PURE__ */ e.jsxs(i, { className: "flex items-center gap-x-4 text-xs", onClick: () => s(t), children: [
210
212
  /* @__PURE__ */ e.jsx(xe, {}),
@@ -301,7 +303,7 @@ function xt() {
301
303
  }
302
304
  )) : null;
303
305
  }
304
- const ds = () => {
306
+ const ps = () => {
305
307
  const t = He(), [s] = Pe(), [o, r, a] = x(), [, c] = Le(), { t: d } = ye(), { createSnapshot: m } = ze(), j = We(), p = Je(), [g] = N(), l = async (n, u) => {
306
308
  const { dragSource: b, relativeIndex: f, dropTargetId: I, monitor: y } = u;
307
309
  if (b) {
@@ -398,5 +400,5 @@ const ds = () => {
398
400
  ) });
399
401
  };
400
402
  export {
401
- ds as default
403
+ ps as default
402
404
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("lodash-es"),s=require("@radix-ui/react-icons"),q=require("react-dnd"),C=require("@minoru/react-dnd-treeview"),N=require("react-i18next"),n=require("./index-H6vIwGfD.cjs"),O=require("lucide-react"),g=require("react"),_=require("./MODIFIERS-2FeVfZQ9.cjs"),B=require("./Functions-N3yhPYKY.cjs"),A=require("./index-jw8RxsTv.cjs"),P=require("./useAddBlockByDrop-inkD7Lck.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const y=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(O.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 c=new RegExp(/\b(sm|md|lg|xl|2xl):(block|grid|flex|inline|inline-grid|inline-flex|inline-block)\b/),l=t.match(c);if(u.nth(l,1))return`Visible >=${r[u.nth(l,1)]}`}return""}const L=t=>{let r="";return Object.keys(t).forEach(o=>{u.startsWith(t[o],_.STYLES_KEY)&&(r=t[o])}),r},F=t=>{var R;const[,r]=n.useHighlightBlockId(),[o]=n.useHiddenBlockIds(),{isSelected:x}=t,{id:c,data:l}=t.node,d=t.depth*10,p=a=>{a.stopPropagation(),t.onToggle(t.node.id)},E=C.useDragOver(c,t.isOpen,t.onToggle),m=g.useMemo(()=>{const a=L(t.node.data);return H(a)},[t.node.data]);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>r(c),className:B.cn("group flex w-full items-center justify-between space-x-px py-px",x?"bg-blue-500 text-white":"hover:bg-gray-200 dark:hover:bg-gray-800"),onClick:a=>{a.stopPropagation(),!o.includes(c)&&t.onSelect(c)},onContextMenu:()=>t.onSelect(c),style:{paddingInlineStart:d},...E,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:`flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${t.isOpen?"rotate-90":""}`,children:t.node.droppable&&e.jsxRuntimeExports.jsx("button",{onClick:p,type:"button",children:e.jsxRuntimeExports.jsx(s.TriangleRightIcon,{})})}),e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 h-3 w-3",children:e.jsxRuntimeExports.jsx(y,{type:l==null?void 0:l._type})}),e.jsxRuntimeExports.jsx("div",{className:"ml-2 truncate text-[11px]",children:((R=t.node.data)==null?void 0:R._name)||t.node.text}),m?e.jsxRuntimeExports.jsxs("span",{className:"ml-2 flex items-center text-[10px] italic "+(x?"text-gray-200":"text-gray-500"),children:["(",m,")"]}):null]})]})})},V=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(y,{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})]})},z=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}})},G=g.lazy(()=>Promise.resolve().then(()=>require("./MarkAsGlobalBlock-X5dNmZcb.cjs"))),$=()=>{const[t]=n.useSelectedBlockIds(),[,r]=n.useCutBlockIds();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.ScissorsIcon,{})," Cut"]})},K=()=>{const[t]=n.useSelectedBlockIds(),[,r]=n.useCopyBlockIds();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.ClipboardIcon,{})," Copy"]})},Q=()=>{const[t]=n.useSelectedBlockIds(),r=n.useRemoveBlocks(),o=n.useSelectedBlock();return e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{disabled:(o==null?void 0:o._type)==="Slot",className:"flex items-center gap-x-4 text-xs",onClick:()=>r(t),children:[e.jsxRuntimeExports.jsx(s.TrashIcon,{})," Remove"]})},U=({id:t=null,openMarkAsGlobalModal:r})=>{const[o]=n.useSelectedBlockIds(),x=n.useDuplicateBlocks(),{pasteBlocks:c,canPaste:l}=n.usePasteBlocks(),d=n.useBuilderProp("globalBlocksSupport",!1),p=g.useCallback(()=>{x(o)},[o,x]);return e.jsxRuntimeExports.jsxs(n.ContextMenuContent,{className:"text-xs",children:[d&&e.jsxRuntimeExports.jsx(n.ContextMenuItem,{className:"flex items-center gap-x-4 border-b text-xs",onClick:r,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-4",children:[e.jsxRuntimeExports.jsx(s.GlobeIcon,{})," Mark as global"]})}),e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:p,children:[e.jsxRuntimeExports.jsx(s.CopyIcon,{})," Duplicate"]}),e.jsxRuntimeExports.jsx($,{}),e.jsxRuntimeExports.jsx(K,{}),e.jsxRuntimeExports.jsxs(n.ContextMenuItem,{className:"flex items-center gap-x-4 text-xs",onClick:()=>c(t),disabled:!l,children:[e.jsxRuntimeExports.jsx(s.ClipboardCopyIcon,{})," Paste"]}),e.jsxRuntimeExports.jsx(Q,{})]})},Y=({children:t,id:r=null})=>{const[o,x]=g.useState(!1);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(n.Dialog,{open:o,onOpenChange:x,children:o&&e.jsxRuntimeExports.jsx(n.DialogContent,{children:e.jsxRuntimeExports.jsx(g.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-96 w-full animate-pulse bg-gray-200"}),children:e.jsxRuntimeExports.jsx(G,{closeModal:()=>x(!1),id:r})})})}),e.jsxRuntimeExports.jsxs(n.ContextMenu,{children:[e.jsxRuntimeExports.jsx(n.ContextMenuTrigger,{children:t}),e.jsxRuntimeExports.jsx(U,{id:r,openMarkAsGlobalModal:()=>x(!0)})]})]})};function W(t){return u.map(t,r=>{const{data:o}=r;return{...o,_parent:r.parent===0?null:r.parent}})}function J(){const[t]=n.useBlocksContainer(),[r,o]=n.useSelectedBlockIds();return t?(console.log("container",t),e.jsxRuntimeExports.jsxs("div",{onClick:x=>{x.stopPropagation(),o(["container"])},className:B.cn("flex items-center pl-2 text-xs",u.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 X=()=>{const t=n.useAllBlocks(),[r]=n.useSetAllBlocks(),[o,x,c]=n.useSelectedBlockIds(),[,l]=n.useSelectedStylingBlocks(),{t:d}=N.useTranslation(),{createSnapshot:p}=n.useCanvasHistory(),E=A.useExpandedIds(),m=P.useAddBlockByDrop(),[R]=n.useBlocksContainer(),a=async(i,j)=>{const{dragSource:h,relativeIndex:b,dropTargetId:k,monitor:f}=j;if(h){p();const T=W(i);r(T);const M=f.getItem();x([M.id])}else await m({block:f.getItem(),dropTargetId:k,relativeIndex:b})},v=u.map(t,i=>({id:i._id,text:i._type,parent:i._parent||0,droppable:!u.isUndefined(u.find(t,{_parent:i._id})),data:i})),S=()=>{x([]),l([])},[{isOver:I},w]=q.useDrop(()=>({accept:["CHAI_BLOCK"],collect:i=>({canDrop:i.canDrop(),isOver:i.isOver()}),drop:i=>{(async()=>await m({block:i,dropTargetId:"",relativeIndex:0}))()}})),{isDragging:D}=q.useDragLayer(i=>({isDragging:i.isDragging()}));return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{onClick:()=>S(),className:B.cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1",D?"bg-green-50/80":"bg-background"),children:u.isEmpty(t)?e.jsxRuntimeExports.jsxs("div",{ref:w,className:`mx-1 mt-4 h-full max-w-full p-6 text-center text-sm text-gray-400 ${I?"bg-blue-200":""}`,children:[I?e.jsxRuntimeExports.jsx(s.DoubleArrowDownIcon,{className:"mx-auto h-12 w-12 animate-bounce"}):e.jsxRuntimeExports.jsx(s.StackIcon,{className:"mx-auto h-10 w-10"}),e.jsxRuntimeExports.jsx("p",{className:"mt-2",children:d(I?"drop_here_message":"tree_view_no_blocks")})]}):e.jsxRuntimeExports.jsxs(n.ScrollArea,{id:"layers-view",className:"no-scrollbar h-full overflow-y-auto p-1",children:[e.jsxRuntimeExports.jsx(J,{}),e.jsxRuntimeExports.jsx(C.Tree,{initialOpen:E,extraAcceptTypes:["CHAI_BLOCK"],tree:v,rootId:0,render:(i,{depth:j,isOpen:h,onToggle:b})=>e.jsxRuntimeExports.jsx(Y,{id:i.id,children:e.jsxRuntimeExports.jsx(F,{onSelect:k=>{l([]),x([k])},isSelected:u.includes(o,i.id),node:i,depth:j,isOpen:h,onToggle:b,toggleIds:c})}),dragPreviewRender:i=>e.jsxRuntimeExports.jsx(V,{monitorProps:i}),onDrop:a,classes:{root:"h-[90%] "+(R?"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:j})=>e.jsxRuntimeExports.jsx(z,{node:i,depth:j})})]})})})};exports.default=X;
@@ -2,15 +2,15 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { GlobeIcon as n } from "@radix-ui/react-icons";
4
4
  import { useState as c } from "react";
5
- import { a0 as d, B as l } from "./index-WKIG_VPl.js";
5
+ import { a0 as d, B as l } from "./index-niHREMmR.js";
6
6
  import { capitalize as x } from "lodash-es";
7
7
  import "./_commonjsHelpers-UyOWmZb0.js";
8
8
  import "@radix-ui/react-toggle";
9
9
  import "class-variance-authority";
10
- import "./utils-Jw11nj1S.js";
10
+ import "./utils-AvyFzbPC.js";
11
+ import "./MODIFIERS-RiXS5Mn1.js";
11
12
  import "clsx";
12
13
  import "tailwind-merge";
13
- import "./MODIFIERS-RiXS5Mn1.js";
14
14
  import "@radix-ui/react-switch";
15
15
  import "@radix-ui/react-slot";
16
16
  import "@radix-ui/react-accordion";
@@ -34,11 +34,12 @@ import "react-dom";
34
34
  import "react-quill";
35
35
  import "jotai";
36
36
  import "flat-to-nested";
37
+ import "./Functions-7jnEwJyw.js";
37
38
  import "redux-undo";
38
39
  import "@chaibuilder/runtime";
39
40
  import "lodash";
40
41
  import "@react-hookz/web";
41
- const tt = ({ id: m = null, closeModal: i }) => {
42
+ const ot = ({ id: m = null, closeModal: i }) => {
42
43
  const { t: o } = p(), e = d(), [r, a] = c("");
43
44
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
44
45
  /* @__PURE__ */ t.jsx("h1", { className: "text-lg font-bold", children: o("mark_as_global") }),
@@ -83,5 +84,5 @@ const tt = ({ id: m = null, closeModal: i }) => {
83
84
  ] });
84
85
  };
85
86
  export {
86
- tt as default
87
+ ot as default
87
88
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react-i18next"),c=require("@radix-ui/react-icons"),x=require("react"),i=require("./index-H6vIwGfD.cjs"),q=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");const m=({id:u=null,closeModal:t})=>{const{t:r}=o.useTranslation(),l=i.useMarkAsGlobalBlock(),[s,n]=x.useState("");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("h1",{className:"text-lg font-bold",children:r("mark_as_global")}),e.jsxRuntimeExports.jsxs("div",{className:"py-2 text-sm",children:[r("global_block_note"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("ul",{className:"mt-4 list-inside list-disc space-y-1",children:[e.jsxRuntimeExports.jsxs("li",{children:[r("global_block_indicator")," ",e.jsxRuntimeExports.jsx(c.GlobeIcon,{className:"inline"})]}),e.jsxRuntimeExports.jsx("li",{children:r("global_block_category")})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"my-4",children:[e.jsxRuntimeExports.jsx("label",{className:"block text-sm font-medium text-gray-400",children:r("enter_global_block_name")}),e.jsxRuntimeExports.jsx("input",{placeholder:r("eg_header_footer"),className:"mt-2 w-full",value:s,onChange:a=>n(a.target.value)})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-4",children:[e.jsxRuntimeExports.jsx(i.Button,{onClick:()=>{l(u,q.capitalize(s)),t()},disabled:s.length<=2,variant:"default",children:r("mark_as_global")}),e.jsxRuntimeExports.jsx(i.Button,{variant:"outline",onClick:t,children:r("cancel")})]})]})};exports.default=m;
@@ -1,17 +1,17 @@
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-7vwIQQ-T.js";
4
+ import { a as l, b as c } from "./index-EGUphg4R.js";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
6
  import "i18next";
7
7
  import "react-i18next";
8
- import "./index-WKIG_VPl.js";
8
+ import "./index-niHREMmR.js";
9
9
  import "@radix-ui/react-toggle";
10
10
  import "class-variance-authority";
11
- import "./utils-Jw11nj1S.js";
11
+ import "./utils-AvyFzbPC.js";
12
+ import "./MODIFIERS-RiXS5Mn1.js";
12
13
  import "clsx";
13
14
  import "tailwind-merge";
14
- import "./MODIFIERS-RiXS5Mn1.js";
15
15
  import "@radix-ui/react-switch";
16
16
  import "@radix-ui/react-slot";
17
17
  import "@radix-ui/react-accordion";
@@ -36,6 +36,7 @@ import "react-dom";
36
36
  import "react-quill";
37
37
  import "jotai";
38
38
  import "flat-to-nested";
39
+ import "./Functions-7jnEwJyw.js";
39
40
  import "redux-undo";
40
41
  import "@chaibuilder/runtime";
41
42
  import "lodash";
@@ -47,11 +48,12 @@ import "react-dnd";
47
48
  import "@minoru/react-dnd-treeview";
48
49
  import "react-hotkeys-hook";
49
50
  import "sonner";
50
- import "./html-to-json-lNLC8Y7D.js";
51
+ import "./html-to-json-57841sEK.js";
51
52
  import "himalaya";
52
53
  import "lucide-react";
53
54
  import "./web-blocks.js";
54
- const x = i.lazy(() => import("./add-page-modal-EQWWxbry.js")), g = i.lazy(() => import("./page-viewer-fohh_Dwv.js")), gt = () => {
55
+ import "./controls-XPXGHKht.js";
56
+ const x = i.lazy(() => import("./add-page-modal-6DlGzdA4.js")), g = i.lazy(() => import("./page-viewer-EoYYnA56.js")), jt = () => {
55
57
  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
58
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
57
59
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: [
@@ -63,5 +65,5 @@ const x = i.lazy(() => import("./add-page-modal-EQWWxbry.js")), g = i.lazy(() =>
63
65
  ] });
64
66
  };
65
67
  export {
66
- gt as default
68
+ jt as default
67
69
  };
@@ -0,0 +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-jw8RxsTv.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-H6vIwGfD.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const a=u.lazy(()=>Promise.resolve().then(()=>require("./add-page-modal-0YAI9dXr.cjs"))),x=u.lazy(()=>Promise.resolve().then(()=>require("./page-viewer-Ou8vDXGV.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;
@@ -0,0 +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-H6vIwGfD.cjs"),a=require("./index-jw8RxsTv.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const d=r.lazy(()=>Promise.resolve().then(()=>require("./project-general-setting-92q4oEYv.cjs"))),q=r.lazy(()=>Promise.resolve().then(()=>require("./project-seo-setting-Snn2nZgS.cjs"))),c=e.jsxRuntimeExports.jsx("div",{className:"px-3",children:e.jsxRuntimeExports.jsx("div",{className:"h-52 w-full animate-pulse rounded-md bg-gray-100"})}),l=t=>t&&x.isEmpty(t.seoData)?{...t,seoData:{title:"",description:"",image:""}}:t;function m(){const t=a.useUpdateProject(),{data:n}=a.useProject(),[i,o]=r.useState(l(n||{})),u=r.useRef(i);return r.useEffect(()=>()=>{x.isEqual(n,u.current)||t.mutate(u.current,{onSuccess:()=>o(u.current)})},[u]),r.useEffect(()=>{u.current=i},[i]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Website Settings"})}),e.jsxRuntimeExports.jsx("hr",{className:"-mx-1"}),e.jsxRuntimeExports.jsx("div",{className:"-mx-1",children:e.jsxRuntimeExports.jsxs(s.Accordion,{type:"single",className:"w-full",defaultValue:"GENERAL",children:[e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"GENERAL",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"General Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-2 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(d,{_projectData:i,seany:o})})})]}),e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:"SEO",className:"border-b-2 border-slate-100 dark:border-slate-800",children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"bg-slate-200 px-2.5 py-1.5 font-medium hover:bg-slate-100 hover:no-underline dark:bg-slate-900 dark:hover:bg-slate-800",children:"SEO Settings"}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"px-1 pt-4 text-sm",children:e.jsxRuntimeExports.jsx(r.Suspense,{fallback:c,children:e.jsxRuntimeExports.jsx(q,{_projectData:i,seany:o})})})]})]})})]})}exports.default=m;