@chaibuilder/sdk 0.1.2 → 0.1.4

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 (81) hide show
  1. package/dist/{AddBlocks-e23baf9a.cjs → AddBlocks-1f683caa.cjs} +1 -1
  2. package/dist/{AddBlocks-b5f37f2f.js → AddBlocks-b6a12d50.js} +19 -19
  3. package/dist/{BrandingOptions-3d1bd24a.cjs → BrandingOptions-02e4ebcf.cjs} +1 -1
  4. package/dist/{BrandingOptions-cfd1b740.js → BrandingOptions-1190723a.js} +27 -27
  5. package/dist/{CanvasArea-a065a586.js → CanvasArea-15458836.js} +19 -18
  6. package/dist/CanvasArea-f5d27245.cjs +60 -0
  7. package/dist/Class-7d6aadbc.cjs +1 -0
  8. package/dist/{Class-e6b07b79.js → Class-e34b2337.js} +9 -9
  9. package/dist/{ImagesPanel-eccf9a56.js → ImagesPanel-8ccab6d9.js} +1 -1
  10. package/dist/{ImagesPanel-cc136c92.cjs → ImagesPanel-addb2bf9.cjs} +1 -1
  11. package/dist/{Layers-f002ba1a.cjs → Layers-06fa708d.cjs} +1 -1
  12. package/dist/{Layers-f935e07b.js → Layers-ff4ef9c0.js} +3 -3
  13. package/dist/{MarkAsGlobalBlock-613bfdab.js → MarkAsGlobalBlock-dea26aa7.js} +2 -2
  14. package/dist/{MarkAsGlobalBlock-5f435dd5.cjs → MarkAsGlobalBlock-fa0e0543.cjs} +1 -1
  15. package/dist/PagesPanel-3e9163c4.js +46 -0
  16. package/dist/PagesPanel-b08e1357.cjs +1 -0
  17. package/dist/ProjectPanel-17c5f131.js +66 -0
  18. package/dist/ProjectPanel-f0b94e3f.cjs +1 -0
  19. package/dist/{Settings-a19fbb69.js → Settings-6f2e86a9.js} +25 -24
  20. package/dist/Settings-739cff3b.cjs +1 -0
  21. package/dist/{SidePanels-67ebbcb4.js → SidePanels-96e64da9.js} +3 -3
  22. package/dist/{SidePanels-af222189.cjs → SidePanels-ce4d41d5.cjs} +1 -1
  23. package/dist/{Topbar-fcb01371.js → Topbar-08d10607.js} +2 -2
  24. package/dist/{Topbar-e92351cc.cjs → Topbar-b97472fc.cjs} +1 -1
  25. package/dist/UnsplashImages-68492dc9.cjs +1 -0
  26. package/dist/{UnsplashImages-fda2f29a.js → UnsplashImages-afaa7706.js} +19 -28
  27. package/dist/add-page-modal-3275cfb2.cjs +1 -0
  28. package/dist/add-page-modal-bcd9249e.js +93 -0
  29. package/dist/alert-dialog-4ce6ed22.cjs +1 -0
  30. package/dist/alert-dialog-ee98f47e.js +64 -0
  31. package/dist/confirm-alert-4f50caa7.cjs +1 -0
  32. package/dist/confirm-alert-f2a47cc7.js +36 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.d.ts +20 -12
  35. package/dist/core.js +53 -52
  36. package/dist/delete-page-modal-420a17e3.cjs +1 -0
  37. package/dist/delete-page-modal-fa7b4272.js +64 -0
  38. package/dist/dropdown-menu-84b2439e.cjs +1 -0
  39. package/dist/dropdown-menu-ae3ed09b.js +164 -0
  40. package/dist/form-5d5c5c9e.js +125 -0
  41. package/dist/form-6eac0287.cjs +1 -0
  42. package/dist/{html-to-json-7510f587.js → html-to-json-9304dbda.js} +1 -1
  43. package/dist/{html-to-json-7eba915f.cjs → html-to-json-9c9961da.cjs} +1 -1
  44. package/dist/index-133d90a5.cjs +2 -0
  45. package/dist/index-3f65447f.js +4754 -0
  46. package/dist/input-42acea7e.cjs +1 -0
  47. package/dist/input-a0ea2bc7.js +19 -0
  48. package/dist/lib.cjs +1 -1
  49. package/dist/lib.js +3 -3
  50. package/dist/link-86c532b5.cjs +1 -0
  51. package/dist/{link-e406254f.js → link-f80a947d.js} +44 -60
  52. package/dist/mockServiceWorker.js +292 -0
  53. package/dist/page-viewer-139bfb2a.cjs +1 -0
  54. package/dist/page-viewer-f1452439.js +88 -0
  55. package/dist/project-general-setting-0d7715b8.cjs +1 -0
  56. package/dist/project-general-setting-e5d14fa6.js +65 -0
  57. package/dist/project-seo-setting-01536592.js +67 -0
  58. package/dist/project-seo-setting-e3924578.cjs +1 -0
  59. package/dist/server.cjs +1 -0
  60. package/dist/server.d.ts +142 -0
  61. package/dist/server.js +126 -0
  62. package/dist/single-page-detail-54d7feca.cjs +1 -0
  63. package/dist/single-page-detail-74f88ed2.js +207 -0
  64. package/dist/ui.cjs +1 -1
  65. package/dist/ui.js +124 -122
  66. package/dist/useMutation-7d536740.cjs +1 -0
  67. package/dist/useMutation-97876a40.js +126 -0
  68. package/dist/usePageActions-ac9ad321.cjs +1 -0
  69. package/dist/usePageActions-de3b7515.js +37 -0
  70. package/dist/useProjectActions-3b1dbb5e.js +18 -0
  71. package/dist/useProjectActions-41af0f70.cjs +1 -0
  72. package/package.json +20 -2
  73. package/dist/CanvasArea-c4554d61.cjs +0 -60
  74. package/dist/Class-0801d193.cjs +0 -1
  75. package/dist/Settings-05b9b5fe.cjs +0 -1
  76. package/dist/UnsplashImages-cca34e45.cjs +0 -1
  77. package/dist/dropdown-menu-a9b096f9.cjs +0 -1
  78. package/dist/dropdown-menu-d912a52e.js +0 -223
  79. package/dist/index-73cf645f.cjs +0 -2
  80. package/dist/index-7e212fbc.js +0 -2657
  81. package/dist/link-1ee70bca.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./jsx-runtime-5c3ac4f7.cjs"),s=require("react"),u=require("./utils-3c452dd0.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const l=c(s),o=l.forwardRef(({className:e,type:r,...t},n)=>i.jsxRuntimeExports.jsx("input",{type:r,className:u.cn("flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));o.displayName="Input";exports.Input=o;
@@ -0,0 +1,19 @@
1
+ import { j as i } from "./jsx-runtime-944c88e2.js";
2
+ import * as t from "react";
3
+ import { c as n } from "./utils-ac68b2c8.js";
4
+ const a = t.forwardRef(({ className: e, type: o, ...r }, s) => /* @__PURE__ */ i.jsx(
5
+ "input",
6
+ {
7
+ type: o,
8
+ className: n(
9
+ "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
10
+ e
11
+ ),
12
+ ref: s,
13
+ ...r
14
+ }
15
+ ));
16
+ a.displayName = "Input";
17
+ export {
18
+ a as I
19
+ };
package/dist/lib.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./utils-3c452dd0.cjs"),r=require("./Class-0801d193.cjs"),T=require("./html-to-json-7eba915f.cjs"),s=require("lodash");require("clsx");require("tailwind-merge");require("himalaya");require("./CONTROLS-031e1de3.cjs");const d={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},k={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"},b=16,V=4;function O(n){return n.indexOf("rem")!==-1&&(n=`${parseFloat(n.replace("rem",""))*b}px`),n}const w=n=>{const p=n.match(/\[.*\]/);if(p===null)return n;const l=r.constructClassObject(n);if(l===null)return n;const{property:m}=l;let e=s.first(p).replace(/\]/i,"").replace(/\[/i,"");const c=n.replace(/\[.*\]/i,"");e=O(e);let a=n;switch(m){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(e.indexOf("px")!==-1){const t=s.map(s.keys(k),i=>`${i}px`);if(s.includes(t,e)){const i=s.parseInt(e.replace("px",""),10);i===1?a=`${c}px`:a=c+i/V}}if(e.indexOf("%")!==-1){const t=s.map(s.keys(d),i=>`${i}%`);if(s.includes(t,e)){const i=parseFloat(e.replace("%",""));a=c+s.get(d,i)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(a=`${c}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(a=`${c}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-w-0");break;case"maxWidth":e==="0px"&&(a="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};s.includes(s.keys(x),e)&&(a=`max-w-${x[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-h-0"),e==="100vh"&&(a="min-h-screen");break;case"fontSize":const o={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};s.includes(s.keys(o),e)&&(a=c+o[e]);break;case"lineHeight":const u={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};s.includes(s.keys(u),e)&&(a=c+u[e]);break;case"zIndex":a=["0","10","20","30","40","50"].indexOf(e)!==-1?`${c}${e}`:n;break;case"opacity":const g=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],f=parseFloat(e)*100;s.includes(g,f.toString())&&(a=`opacity-${f}`);break}return a};exports.cn=h.cn;exports.generateUUID=r.generateUUID;exports.getBreakpointValue=r.getBreakpointValue;exports.getBlocksFromHTML=T.getBlocksFromHTML;exports.convertArbitraryToTailwindClass=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./utils-3c452dd0.cjs"),r=require("./Class-7d6aadbc.cjs"),T=require("./html-to-json-9c9961da.cjs"),s=require("lodash");require("clsx");require("tailwind-merge");require("himalaya");require("./CONTROLS-031e1de3.cjs");const d={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},k={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"},b=16,V=4;function O(n){return n.indexOf("rem")!==-1&&(n=`${parseFloat(n.replace("rem",""))*b}px`),n}const w=n=>{const p=n.match(/\[.*\]/);if(p===null)return n;const l=r.constructClassObject(n);if(l===null)return n;const{property:m}=l;let e=s.first(p).replace(/\]/i,"").replace(/\[/i,"");const c=n.replace(/\[.*\]/i,"");e=O(e);let a=n;switch(m){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(e.indexOf("px")!==-1){const t=s.map(s.keys(k),i=>`${i}px`);if(s.includes(t,e)){const i=s.parseInt(e.replace("px",""),10);i===1?a=`${c}px`:a=c+i/V}}if(e.indexOf("%")!==-1){const t=s.map(s.keys(d),i=>`${i}%`);if(s.includes(t,e)){const i=parseFloat(e.replace("%",""));a=c+s.get(d,i)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(a=`${c}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(a=`${c}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-w-0");break;case"maxWidth":e==="0px"&&(a="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};s.includes(s.keys(x),e)&&(a=`max-w-${x[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${c}full`),e==="0px"&&(a="min-h-0"),e==="100vh"&&(a="min-h-screen");break;case"fontSize":const o={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};s.includes(s.keys(o),e)&&(a=c+o[e]);break;case"lineHeight":const u={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};s.includes(s.keys(u),e)&&(a=c+u[e]);break;case"zIndex":a=["0","10","20","30","40","50"].indexOf(e)!==-1?`${c}${e}`:n;break;case"opacity":const g=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],f=parseFloat(e)*100;s.includes(g,f.toString())&&(a=`opacity-${f}`);break}return a};exports.cn=h.cn;exports.generateUUID=r.generateUUID;exports.getBreakpointValue=r.getBreakpointValue;exports.getBlocksFromHTML=T.getBlocksFromHTML;exports.convertArbitraryToTailwindClass=w;
package/dist/lib.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { c as R } from "./utils-ac68b2c8.js";
2
- import { c as T } from "./Class-e6b07b79.js";
3
- import { g as z, a as C } from "./Class-e6b07b79.js";
4
- import { g as M } from "./html-to-json-7510f587.js";
2
+ import { c as T } from "./Class-e34b2337.js";
3
+ import { g as z, a as C } from "./Class-e34b2337.js";
4
+ import { g as M } from "./html-to-json-9304dbda.js";
5
5
  import { first as V, includes as t, keys as i, map as u, parseInt as b, get as O } from "lodash";
6
6
  import "clsx";
7
7
  import "tailwind-merge";
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./jsx-runtime-5c3ac4f7.cjs"),m=require("react-icons-picker"),h=require("react-dom"),g=require("lodash"),d=require("react"),x=require("./dialog-170eaad9.cjs"),j=require("./ImagesPanel-addb2bf9.cjs"),R=require("react-quill");require("react-i18next");const E=require("./useBuilderProp-5e57d0c8.cjs"),f=t=>{const s=document.getElementById("icon-picker-field"),r=document.createElement("div");h.render(e.jsxRuntimeExports.jsx(m.IconPickerItem,{value:t}),r),s.appendChild(r),r.hidden=!0;const l=r.innerHTML;return setTimeout(()=>s.removeChild(r),1e3),l},k=({value:t,onChange:s,onBlur:r,id:l})=>{const a=o=>{s("<svg />");const i=f(o);s(i),r(l,i)};return e.jsxRuntimeExports.jsxs("div",{className:"mt-1 flex h-20 items-center gap-x-2",id:"icon-picker-field",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative h-12 w-12",children:[e.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:t==null?void 0:t.replace("<svg",'<svg class="h-5 w-5"')},className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white hover:hidden"}),e.jsxRuntimeExports.jsx(m,{value:t?"BiSolidGrid":null,onChange:a,pickButtonStyle:{height:"48px",width:"48px",border:"1px solid #BBBBBB",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px"},searchInputStyle:{backgroundColor:"transparent",width:"100%",border:"1px solid #BBBBBB",margin:"0px 10px",padding:"10px"}})]}),e.jsxRuntimeExports.jsx("textarea",{value:t,onChange:o=>s(o.target.value),className:"h-full w-full rounded-sm border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",placeholder:"Choose icon or enter svg"})]})},b=({children:t,onSelect:s})=>{const[r,l]=d.useState(!1),a=(...o)=>{s.call(void 0,...o),l(!1)};return e.jsxRuntimeExports.jsxs(x.Dialog,{open:r,onOpenChange:o=>l(o),children:[e.jsxRuntimeExports.jsx(x.DialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsx(x.DialogContent,{className:"flex h-3/4 max-w-5xl",children:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:e.jsxRuntimeExports.jsx(j.default,{isModalView:!0,onSelect:a})})})]})},p=b,v=({value:t,onChange:s,id:r,onBlur:l})=>e.jsxRuntimeExports.jsxs("div",{className:"mt-1.5 flex items-center gap-x-3",children:[t?e.jsxRuntimeExports.jsx("img",{src:t,className:"h-20 w-20 overflow-hidden rounded-md border object-cover",alt:""}):e.jsxRuntimeExports.jsx(p,{onSelect:s,children:e.jsxRuntimeExports.jsx("div",{className:"h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400"})}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-3/5 flex-col",children:[e.jsxRuntimeExports.jsx(p,{onSelect:s,children:e.jsxRuntimeExports.jsx("small",{className:"cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700",children:t||!g.isEmpty(t)?"Replace Image":"Choose Image"})}),e.jsxRuntimeExports.jsx("small",{className:"-pl-4 pt-2 text-center text-xs text-gray-600",children:"OR"}),e.jsxRuntimeExports.jsx("input",{type:"url",className:"text-xs",placeholder:"Enter image URL",value:t,onBlur:({target:{value:a}})=>l(r,a),onChange:a=>s(a.target.value)})]})]}),y=({id:t,placeholder:s,value:r,onChange:l,onBlur:a})=>{const o={toolbar:[["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]},{align:[]}],["link","clean"]]},i=["header","font","list","bold","italic","underline","strike","blockquote","color","background","align","link","image"];return typeof window>"u"?null:e.jsxRuntimeExports.jsx(R,{id:t,value:r,onBlur:c=>a(t,c),onChange:c=>l(c),modules:o,formats:i,placeholder:s,className:"mt-1 rounded-md"})},w=({schema:t,formData:s,onChange:r})=>{const[l,a]=d.useState([]),o=E.useBuilderProp("getPages",()=>[]),{type:i="page",href:c="",target:u="self"}=s;return d.useEffect(()=>{(async()=>{const n=await o();a(n)})()},[o]),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium",children:(t==null?void 0:t.title)??"Link"}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1.5",children:[e.jsxRuntimeExports.jsx("select",{name:"type",defaultValue:"page",value:i,onChange:n=>r({...s,type:n.target.value}),children:[{const:"page",title:"Open Page"},{const:"url",title:"Open URL"},{const:"email",title:"Compose Email"},{const:"telephone",title:"Call Phone"},{const:"scroll",title:"Scroll to element"}].map(n=>e.jsxRuntimeExports.jsx("option",{value:n.const,children:n.title},n.const))}),i==="page"?e.jsxRuntimeExports.jsxs("select",{name:"href",defaultValue:"",placeholder:"Choose Page",value:c,onChange:n=>r({...s,href:n.target.value}),children:[e.jsxRuntimeExports.jsx("option",{value:"",children:"Choose page"}),g.map(l,n=>e.jsxRuntimeExports.jsx("option",{value:n.slug,children:n.page_name},n.uuid))]}):e.jsxRuntimeExports.jsx("input",{name:"href",type:"text",value:c,onChange:n=>r({...s,href:n.target.value}),placeholder:i==="page"||i==="url"?"Enter URL":i==="scroll"?"#ElementID":"Enter detail"}),(i==="page"||i==="url")&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("input",{type:"checkbox",defaultChecked:u==="_blank",className:"cursor-pointer rounded-md border border-border",onChange:()=>r({...s,target:u==="_blank"?"_self":"_blank"})}),e.jsxRuntimeExports.jsx("span",{className:"pt-1 text-xs",children:"Open in new tab"})]})]})]})};exports.IconPickerField=k;exports.ImagePickerField=v;exports.LinkField=w;exports.RichTextEditorField=y;
@@ -1,38 +1,23 @@
1
1
  import { j as e } from "./jsx-runtime-944c88e2.js";
2
- import * as m from "react";
3
- import { useState as u, useEffect as x } from "react";
4
- import { c as g } from "./utils-ac68b2c8.js";
5
- import h, { IconPickerItem as f } from "react-icons-picker";
6
- import b from "react-dom";
7
- import { isEmpty as j, map as k } from "lodash";
8
- import { D as v, b as y, a as w } from "./dialog-3d4e82ed.js";
9
- import I from "./ImagesPanel-eccf9a56.js";
10
- import N from "react-quill";
2
+ import x, { IconPickerItem as m } from "react-icons-picker";
3
+ import g from "react-dom";
4
+ import { isEmpty as h, map as f } from "lodash";
5
+ import { useState as u, useEffect as j } from "react";
6
+ import { D as b, b as k, a as v } from "./dialog-3d4e82ed.js";
7
+ import y from "./ImagesPanel-8ccab6d9.js";
8
+ import w from "react-quill";
11
9
  import "react-i18next";
12
- import { u as B } from "./useBuilderProp-81a14920.js";
13
- const P = m.forwardRef(({ className: t, type: r, ...s }, n) => /* @__PURE__ */ e.jsx(
14
- "input",
15
- {
16
- type: r,
17
- className: g(
18
- "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
19
- t
20
- ),
21
- ref: n,
22
- ...s
23
- }
24
- ));
25
- P.displayName = "Input";
26
- const C = (t) => {
27
- const r = document.getElementById("icon-picker-field"), s = document.createElement("div");
28
- b.render(/* @__PURE__ */ e.jsx(f, { value: t }), s), r.appendChild(s), s.hidden = !0;
29
- const n = s.innerHTML;
30
- return setTimeout(() => r.removeChild(s), 1e3), n;
31
- }, R = ({ value: t, onChange: r, onBlur: s, id: n }) => {
10
+ import { u as N } from "./useBuilderProp-81a14920.js";
11
+ const B = (t) => {
12
+ const r = document.getElementById("icon-picker-field"), l = document.createElement("div");
13
+ g.render(/* @__PURE__ */ e.jsx(m, { value: t }), l), r.appendChild(l), l.hidden = !0;
14
+ const n = l.innerHTML;
15
+ return setTimeout(() => r.removeChild(l), 1e3), n;
16
+ }, F = ({ value: t, onChange: r, onBlur: l, id: n }) => {
32
17
  const i = (o) => {
33
18
  r("<svg />");
34
- const a = C(o);
35
- r(a), s(n, a);
19
+ const a = B(o);
20
+ r(a), l(n, a);
36
21
  };
37
22
  return /* @__PURE__ */ e.jsxs("div", { className: "mt-1 flex h-20 items-center gap-x-2", id: "icon-picker-field", children: [
38
23
  /* @__PURE__ */ e.jsxs("div", { className: "relative h-12 w-12", children: [
@@ -44,7 +29,7 @@ const C = (t) => {
44
29
  }
45
30
  ),
46
31
  /* @__PURE__ */ e.jsx(
47
- h,
32
+ x,
48
33
  {
49
34
  value: t ? "BiSolidGrid" : null,
50
35
  onChange: i,
@@ -77,18 +62,18 @@ const C = (t) => {
77
62
  }
78
63
  )
79
64
  ] });
80
- }, z = R, E = ({ children: t, onSelect: r }) => {
81
- const [s, n] = u(!1), i = (...o) => {
65
+ }, C = ({ children: t, onSelect: r }) => {
66
+ const [l, n] = u(!1), i = (...o) => {
82
67
  r.call(void 0, ...o), n(!1);
83
68
  };
84
- return /* @__PURE__ */ e.jsxs(v, { open: s, onOpenChange: (o) => n(o), children: [
85
- /* @__PURE__ */ e.jsx(y, { asChild: !0, children: t }),
86
- /* @__PURE__ */ e.jsx(w, { className: "flex h-3/4 max-w-5xl", children: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ e.jsx(I, { isModalView: !0, onSelect: i }) }) })
69
+ return /* @__PURE__ */ e.jsxs(b, { open: l, onOpenChange: (o) => n(o), children: [
70
+ /* @__PURE__ */ e.jsx(k, { asChild: !0, children: t }),
71
+ /* @__PURE__ */ e.jsx(v, { className: "flex h-3/4 max-w-5xl", children: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ e.jsx(y, { isModalView: !0, onSelect: i }) }) })
87
72
  ] });
88
- }, p = E, S = ({ value: t, onChange: r, id: s, onBlur: n }) => /* @__PURE__ */ e.jsxs("div", { className: "mt-1.5 flex items-center gap-x-3", children: [
73
+ }, p = C, A = ({ value: t, onChange: r, id: l, onBlur: n }) => /* @__PURE__ */ e.jsxs("div", { className: "mt-1.5 flex items-center gap-x-3", children: [
89
74
  t ? /* @__PURE__ */ e.jsx("img", { src: t, className: "h-20 w-20 overflow-hidden rounded-md border object-cover", alt: "" }) : /* @__PURE__ */ e.jsx(p, { onSelect: r, children: /* @__PURE__ */ e.jsx("div", { className: "h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400" }) }),
90
75
  /* @__PURE__ */ e.jsxs("div", { className: "flex w-3/5 flex-col", children: [
91
- /* @__PURE__ */ e.jsx(p, { onSelect: r, children: /* @__PURE__ */ e.jsx("small", { className: "cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700", children: t || !j(t) ? "Replace Image" : "Choose Image" }) }),
76
+ /* @__PURE__ */ e.jsx(p, { onSelect: r, children: /* @__PURE__ */ e.jsx("small", { className: "cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700", children: t || !h(t) ? "Replace Image" : "Choose Image" }) }),
92
77
  /* @__PURE__ */ e.jsx("small", { className: "-pl-4 pt-2 text-center text-xs text-gray-600", children: "OR" }),
93
78
  /* @__PURE__ */ e.jsx(
94
79
  "input",
@@ -97,12 +82,12 @@ const C = (t) => {
97
82
  className: "text-xs",
98
83
  placeholder: "Enter image URL",
99
84
  value: t,
100
- onBlur: ({ target: { value: i } }) => n(s, i),
85
+ onBlur: ({ target: { value: i } }) => n(l, i),
101
86
  onChange: (i) => r(i.target.value)
102
87
  }
103
88
  )
104
89
  ] })
105
- ] }), G = S, _ = ({ id: t, placeholder: r, value: s, onChange: n, onBlur: i }) => {
90
+ ] }), U = ({ id: t, placeholder: r, value: l, onChange: n, onBlur: i }) => {
106
91
  const o = {
107
92
  toolbar: [
108
93
  ["bold", "italic", "underline", "strike", "blockquote"],
@@ -126,10 +111,10 @@ const C = (t) => {
126
111
  "image"
127
112
  ];
128
113
  return typeof window > "u" ? null : /* @__PURE__ */ e.jsx(
129
- N,
114
+ w,
130
115
  {
131
116
  id: t,
132
- value: s,
117
+ value: l,
133
118
  onBlur: (c) => i(t, c),
134
119
  onChange: (c) => n(c),
135
120
  modules: o,
@@ -138,12 +123,12 @@ const C = (t) => {
138
123
  className: "mt-1 rounded-md"
139
124
  }
140
125
  );
141
- }, Q = _, L = ({ schema: t, formData: r, onChange: s }) => {
142
- const [n, i] = u([]), o = B("getPages", () => []), { type: a = "page", href: c = "", target: d = "self" } = r;
143
- return x(() => {
126
+ }, V = ({ schema: t, formData: r, onChange: l }) => {
127
+ const [n, i] = u([]), o = N("getPages", () => []), { type: a = "page", href: c = "", target: d = "self" } = r;
128
+ return j(() => {
144
129
  (async () => {
145
- const l = await o();
146
- i(l);
130
+ const s = await o();
131
+ i(s);
147
132
  })();
148
133
  }, [o]), /* @__PURE__ */ e.jsxs("div", { children: [
149
134
  /* @__PURE__ */ e.jsx("span", { className: "text-xs font-medium", children: (t == null ? void 0 : t.title) ?? "Link" }),
@@ -154,14 +139,14 @@ const C = (t) => {
154
139
  name: "type",
155
140
  defaultValue: "page",
156
141
  value: a,
157
- onChange: (l) => s({ ...r, type: l.target.value }),
142
+ onChange: (s) => l({ ...r, type: s.target.value }),
158
143
  children: [
159
144
  { const: "page", title: "Open Page" },
160
145
  { const: "url", title: "Open URL" },
161
146
  { const: "email", title: "Compose Email" },
162
147
  { const: "telephone", title: "Call Phone" },
163
148
  { const: "scroll", title: "Scroll to element" }
164
- ].map((l) => /* @__PURE__ */ e.jsx("option", { value: l.const, children: l.title }, l.const))
149
+ ].map((s) => /* @__PURE__ */ e.jsx("option", { value: s.const, children: s.title }, s.const))
165
150
  }
166
151
  ),
167
152
  a === "page" ? /* @__PURE__ */ e.jsxs(
@@ -171,10 +156,10 @@ const C = (t) => {
171
156
  defaultValue: "",
172
157
  placeholder: "Choose Page",
173
158
  value: c,
174
- onChange: (l) => s({ ...r, href: l.target.value }),
159
+ onChange: (s) => l({ ...r, href: s.target.value }),
175
160
  children: [
176
161
  /* @__PURE__ */ e.jsx("option", { value: "", children: "Choose page" }),
177
- k(n, (l) => /* @__PURE__ */ e.jsx("option", { value: l.slug, children: l.page_name }, l.uuid))
162
+ f(n, (s) => /* @__PURE__ */ e.jsx("option", { value: s.slug, children: s.page_name }, s.uuid))
178
163
  ]
179
164
  }
180
165
  ) : /* @__PURE__ */ e.jsx(
@@ -183,7 +168,7 @@ const C = (t) => {
183
168
  name: "href",
184
169
  type: "text",
185
170
  value: c,
186
- onChange: (l) => s({ ...r, href: l.target.value }),
171
+ onChange: (s) => l({ ...r, href: s.target.value }),
187
172
  placeholder: a === "page" || a === "url" ? "Enter URL" : a === "scroll" ? "#ElementID" : "Enter detail"
188
173
  }
189
174
  ),
@@ -194,18 +179,17 @@ const C = (t) => {
194
179
  type: "checkbox",
195
180
  defaultChecked: d === "_blank",
196
181
  className: "cursor-pointer rounded-md border border-border",
197
- onChange: () => s({ ...r, target: d === "_blank" ? "_self" : "_blank" })
182
+ onChange: () => l({ ...r, target: d === "_blank" ? "_self" : "_blank" })
198
183
  }
199
184
  ),
200
185
  /* @__PURE__ */ e.jsx("span", { className: "pt-1 text-xs", children: "Open in new tab" })
201
186
  ] })
202
187
  ] })
203
188
  ] });
204
- }, J = L;
189
+ };
205
190
  export {
206
- P as I,
207
- J as L,
208
- Q as R,
209
- z as a,
210
- G as b
191
+ F as I,
192
+ V as L,
193
+ U as R,
194
+ A as a
211
195
  };
@@ -0,0 +1,292 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+
4
+ /**
5
+ * Mock Service Worker (2.0.8).
6
+ * @see https://github.com/mswjs/msw
7
+ * - Please do NOT modify this file.
8
+ * - Please do NOT serve this file on production.
9
+ */
10
+
11
+ const INTEGRITY_CHECKSUM = '0877fcdc026242810f5bfde0d7178db4'
12
+ const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
13
+ const activeClientIds = new Set()
14
+
15
+ self.addEventListener('install', function () {
16
+ self.skipWaiting()
17
+ })
18
+
19
+ self.addEventListener('activate', function (event) {
20
+ event.waitUntil(self.clients.claim())
21
+ })
22
+
23
+ self.addEventListener('message', async function (event) {
24
+ const clientId = event.source.id
25
+
26
+ if (!clientId || !self.clients) {
27
+ return
28
+ }
29
+
30
+ const client = await self.clients.get(clientId)
31
+
32
+ if (!client) {
33
+ return
34
+ }
35
+
36
+ const allClients = await self.clients.matchAll({
37
+ type: 'window',
38
+ })
39
+
40
+ switch (event.data) {
41
+ case 'KEEPALIVE_REQUEST': {
42
+ sendToClient(client, {
43
+ type: 'KEEPALIVE_RESPONSE',
44
+ })
45
+ break
46
+ }
47
+
48
+ case 'INTEGRITY_CHECK_REQUEST': {
49
+ sendToClient(client, {
50
+ type: 'INTEGRITY_CHECK_RESPONSE',
51
+ payload: INTEGRITY_CHECKSUM,
52
+ })
53
+ break
54
+ }
55
+
56
+ case 'MOCK_ACTIVATE': {
57
+ activeClientIds.add(clientId)
58
+
59
+ sendToClient(client, {
60
+ type: 'MOCKING_ENABLED',
61
+ payload: true,
62
+ })
63
+ break
64
+ }
65
+
66
+ case 'MOCK_DEACTIVATE': {
67
+ activeClientIds.delete(clientId)
68
+ break
69
+ }
70
+
71
+ case 'CLIENT_CLOSED': {
72
+ activeClientIds.delete(clientId)
73
+
74
+ const remainingClients = allClients.filter((client) => {
75
+ return client.id !== clientId
76
+ })
77
+
78
+ // Unregister itself when there are no more clients
79
+ if (remainingClients.length === 0) {
80
+ self.registration.unregister()
81
+ }
82
+
83
+ break
84
+ }
85
+ }
86
+ })
87
+
88
+ self.addEventListener('fetch', function (event) {
89
+ const { request } = event
90
+
91
+ // Bypass navigation requests.
92
+ if (request.mode === 'navigate') {
93
+ return
94
+ }
95
+
96
+ // Opening the DevTools triggers the "only-if-cached" request
97
+ // that cannot be handled by the worker. Bypass such requests.
98
+ if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
99
+ return
100
+ }
101
+
102
+ // Bypass all requests when there are no active clients.
103
+ // Prevents the self-unregistered worked from handling requests
104
+ // after it's been deleted (still remains active until the next reload).
105
+ if (activeClientIds.size === 0) {
106
+ return
107
+ }
108
+
109
+ // Generate unique request ID.
110
+ const requestId = crypto.randomUUID()
111
+ event.respondWith(handleRequest(event, requestId))
112
+ })
113
+
114
+ async function handleRequest(event, requestId) {
115
+ const client = await resolveMainClient(event)
116
+ const response = await getResponse(event, client, requestId)
117
+
118
+ // Send back the response clone for the "response:*" life-cycle events.
119
+ // Ensure MSW is active and ready to handle the message, otherwise
120
+ // this message will pend indefinitely.
121
+ if (client && activeClientIds.has(client.id)) {
122
+ ;(async function () {
123
+ const responseClone = response.clone()
124
+ // When performing original requests, response body will
125
+ // always be a ReadableStream, even for 204 responses.
126
+ // But when creating a new Response instance on the client,
127
+ // the body for a 204 response must be null.
128
+ const responseBody = response.status === 204 ? null : responseClone.body
129
+
130
+ sendToClient(
131
+ client,
132
+ {
133
+ type: 'RESPONSE',
134
+ payload: {
135
+ requestId,
136
+ isMockedResponse: IS_MOCKED_RESPONSE in response,
137
+ type: responseClone.type,
138
+ status: responseClone.status,
139
+ statusText: responseClone.statusText,
140
+ body: responseBody,
141
+ headers: Object.fromEntries(responseClone.headers.entries()),
142
+ },
143
+ },
144
+ [responseBody],
145
+ )
146
+ })()
147
+ }
148
+
149
+ return response
150
+ }
151
+
152
+ // Resolve the main client for the given event.
153
+ // Client that issues a request doesn't necessarily equal the client
154
+ // that registered the worker. It's with the latter the worker should
155
+ // communicate with during the response resolving phase.
156
+ async function resolveMainClient(event) {
157
+ const client = await self.clients.get(event.clientId)
158
+
159
+ if (client?.frameType === 'top-level') {
160
+ return client
161
+ }
162
+
163
+ const allClients = await self.clients.matchAll({
164
+ type: 'window',
165
+ })
166
+
167
+ return allClients
168
+ .filter((client) => {
169
+ // Get only those clients that are currently visible.
170
+ return client.visibilityState === 'visible'
171
+ })
172
+ .find((client) => {
173
+ // Find the client ID that's recorded in the
174
+ // set of clients that have registered the worker.
175
+ return activeClientIds.has(client.id)
176
+ })
177
+ }
178
+
179
+ async function getResponse(event, client, requestId) {
180
+ const { request } = event
181
+
182
+ // Clone the request because it might've been already used
183
+ // (i.e. its body has been read and sent to the client).
184
+ const requestClone = request.clone()
185
+
186
+ function passthrough() {
187
+ const headers = Object.fromEntries(requestClone.headers.entries())
188
+
189
+ // Remove internal MSW request header so the passthrough request
190
+ // complies with any potential CORS preflight checks on the server.
191
+ // Some servers forbid unknown request headers.
192
+ delete headers['x-msw-intention']
193
+
194
+ return fetch(requestClone, { headers })
195
+ }
196
+
197
+ // Bypass mocking when the client is not active.
198
+ if (!client) {
199
+ return passthrough()
200
+ }
201
+
202
+ // Bypass initial page load requests (i.e. static assets).
203
+ // The absence of the immediate/parent client in the map of the active clients
204
+ // means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
205
+ // and is not ready to handle requests.
206
+ if (!activeClientIds.has(client.id)) {
207
+ return passthrough()
208
+ }
209
+
210
+ // Bypass requests with the explicit bypass header.
211
+ // Such requests can be issued by "ctx.fetch()".
212
+ const mswIntention = request.headers.get('x-msw-intention')
213
+ if (['bypass', 'passthrough'].includes(mswIntention)) {
214
+ return passthrough()
215
+ }
216
+
217
+ // Notify the client that a request has been intercepted.
218
+ const requestBuffer = await request.arrayBuffer()
219
+ const clientMessage = await sendToClient(
220
+ client,
221
+ {
222
+ type: 'REQUEST',
223
+ payload: {
224
+ id: requestId,
225
+ url: request.url,
226
+ mode: request.mode,
227
+ method: request.method,
228
+ headers: Object.fromEntries(request.headers.entries()),
229
+ cache: request.cache,
230
+ credentials: request.credentials,
231
+ destination: request.destination,
232
+ integrity: request.integrity,
233
+ redirect: request.redirect,
234
+ referrer: request.referrer,
235
+ referrerPolicy: request.referrerPolicy,
236
+ body: requestBuffer,
237
+ keepalive: request.keepalive,
238
+ },
239
+ },
240
+ [requestBuffer],
241
+ )
242
+
243
+ switch (clientMessage.type) {
244
+ case 'MOCK_RESPONSE': {
245
+ return respondWithMock(clientMessage.data)
246
+ }
247
+
248
+ case 'MOCK_NOT_FOUND': {
249
+ return passthrough()
250
+ }
251
+ }
252
+
253
+ return passthrough()
254
+ }
255
+
256
+ function sendToClient(client, message, transferrables = []) {
257
+ return new Promise((resolve, reject) => {
258
+ const channel = new MessageChannel()
259
+
260
+ channel.port1.onmessage = (event) => {
261
+ if (event.data && event.data.error) {
262
+ return reject(event.data.error)
263
+ }
264
+
265
+ resolve(event.data)
266
+ }
267
+
268
+ client.postMessage(
269
+ message,
270
+ [channel.port2].concat(transferrables.filter(Boolean)),
271
+ )
272
+ })
273
+ }
274
+
275
+ async function respondWithMock(response) {
276
+ // Setting response status code to 0 is a no-op.
277
+ // However, when responding with a "Response.error()", the produced Response
278
+ // instance will have status code set to 0. Since it's not possible to create
279
+ // a Response instance with status code 0, handle that use-case separately.
280
+ if (response.status === 0) {
281
+ return Response.error()
282
+ }
283
+
284
+ const mockedResponse = new Response(response.body, response)
285
+
286
+ Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, {
287
+ value: true,
288
+ enumerable: true,
289
+ })
290
+
291
+ return mockedResponse
292
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),n=require("react"),u=require("@radix-ui/react-icons"),o=require("./popover-7cb9079b.cjs"),c=require("./index-133d90a5.cjs");require("@radix-ui/react-popover");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./useBuilderProp-5e57d0c8.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("react-hotkeys-hook");require("flat-to-nested");require("./Class-7d6aadbc.cjs");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("./CONTROLS-031e1de3.cjs");const j=n.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-54d7feca.cjs"))),m=({pageData:r})=>{const[s,t]=n.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:s==="OPEN"||s==="ALERT"||s==="PENDING",onOpenChange:i=>{t(s==="PENDING"?"ALERT":i?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:i=>{i.stopPropagation(),t("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:s==="OPEN"||s==="ALERT"||s==="PENDING"?e.jsxRuntimeExports.jsx(u.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(u.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(j,{pageData:r,open:s,setOpen:t})})})]})},p=r=>{const[s]=["123"],{data:t}=c.useProject(),i={},x=(t==null?void 0:t.homepage)===r.uuid,l=s===r.uuid,a=()=>i(r);return t?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${l?"bg-blue-200 ":""}`,onClick:a,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[x?e.jsxRuntimeExports.jsx(u.HomeIcon,{}):e.jsxRuntimeExports.jsx(u.FileTextIcon,{})," ",r.name]}),e.jsxRuntimeExports.jsx(m,{pageData:r})]}):null},d=({pages:r,isLoading:s})=>s?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):r.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:n.Children.toArray(r.map(t=>e.jsxRuntimeExports.jsx(p,{...t})))});exports.default=d;