@chaibuilder/sdk 1.2.15 → 1.2.17

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 (109) hide show
  1. package/README.md +6 -4
  2. package/dist/AddBlocks--SllKzEG.js +224 -0
  3. package/dist/AddBlocks-7TF41ISQ.cjs +1 -0
  4. package/dist/{BrandingOptions-t_MjeHSM.js → BrandingOptions-IqtZrxqX.js} +14 -15
  5. package/dist/BrandingOptions-uKE1vuWd.cjs +1 -0
  6. package/dist/{CanvasArea-TR5t1xxh.js → CanvasArea-T1XNnB7d.js} +89 -95
  7. package/dist/{CanvasArea-SBeW-Kdq.cjs → CanvasArea-iLUw-tom.cjs} +3 -3
  8. package/dist/{Class-17XFhL48.js → Class-3k8xjeiM.js} +1 -1
  9. package/dist/{Class-5ARpH_Tu.cjs → Class-MmCxz2Ay.cjs} +1 -1
  10. package/dist/CurrentPage-N5hSL1xB.cjs +1 -0
  11. package/dist/{CurrentPage-JUlhyVbI.js → CurrentPage-TCduhO-X.js} +16 -16
  12. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  13. package/dist/{MODIFIERS-RiXS5Mn1.js → MODIFIERS-WQdaNvb8.js} +5 -4
  14. package/dist/{Layers-Dav1kBNN.js → Outline-3IPrK7F-.js} +153 -145
  15. package/dist/Outline-g4TXJ-hK.cjs +1 -0
  16. package/dist/{PagesPanel--feFCDeH.js → PagesPanel-7goyNL8t.js} +10 -10
  17. package/dist/PagesPanel-qI3sijis.cjs +1 -0
  18. package/dist/{ProjectPanel--Vq6HSMl.js → ProjectPanel-CdPFwsXg.js} +8 -8
  19. package/dist/ProjectPanel-bMllQ4_a.cjs +1 -0
  20. package/dist/Settings-8f4ivm4-.cjs +1 -0
  21. package/dist/{Settings-DjE6HR2E.js → Settings-pva9XRUC.js} +293 -293
  22. package/dist/SidePanels-7HqZM4-j.cjs +1 -0
  23. package/dist/SidePanels-u5QXQrWL.js +389 -0
  24. package/dist/Topbar-S3zgo3N8.js +129 -0
  25. package/dist/Topbar-poeqjjZb.cjs +1 -0
  26. package/dist/{UnsplashImages-ppQXZ28F.js → UnsplashImages-132gZ842.js} +13 -13
  27. package/dist/{UnsplashImages-SrxA-yNu.cjs → UnsplashImages-BOypn-e5.cjs} +1 -1
  28. package/dist/UploadImages-giiNNHKq.cjs +1 -0
  29. package/dist/{UploadImages-IKR4oX2k.js → UploadImages-tr54Ik1I.js} +35 -31
  30. package/dist/{add-page-modal-nZJaunuz.js → add-page-modal-AsP5g0Fp.js} +13 -12
  31. package/dist/add-page-modal-ajpd-Gmw.cjs +1 -0
  32. package/dist/{confirm-alert-uV_PtYc3.cjs → confirm-alert-bw0VBgoG.cjs} +1 -1
  33. package/dist/{confirm-alert-QKtbNbWz.js → confirm-alert-dYoU1ln_.js} +5 -5
  34. package/dist/controls-Dy1qa8Dc.cjs +1 -0
  35. package/dist/{empty-slot-5FRrRq1E.js → controls-XPXGHKht.js} +50 -61
  36. package/dist/core.cjs +1 -1
  37. package/dist/core.d.ts +16 -1
  38. package/dist/core.js +47 -53
  39. package/dist/{defaultTheme-IH19g4fv.cjs → defaultTheme-1XwPZT2b.cjs} +1 -1
  40. package/dist/{defaultTheme-YY8mlQS3.js → defaultTheme-s0cpA5Oy.js} +1 -1
  41. package/dist/delete-page-modal-H4JOWYZe.cjs +1 -0
  42. package/dist/{delete-page-modal-pN5cFz-m.js → delete-page-modal-_Hy6ls6b.js} +12 -12
  43. package/dist/email-blocks.cjs +1 -1
  44. package/dist/email-blocks.js +11 -10
  45. package/dist/email.cjs +1 -1
  46. package/dist/email.d.ts +13 -0
  47. package/dist/email.js +7 -12
  48. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  49. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  50. package/dist/{form-faX0Yn4Q.js → form-f13cs-An.js} +1 -1
  51. package/dist/{form-KkP1F7h1.cjs → form-jzX2YXUO.cjs} +1 -1
  52. package/dist/{html-to-json-57841sEK.js → html-to-json-C5sExaSD.js} +1 -1
  53. package/dist/{html-to-json-2PeOCVey.cjs → html-to-json-FGufPv9R.cjs} +1 -1
  54. package/dist/index-0JU8vPT_.cjs +206 -0
  55. package/dist/index-4xyhDki2.cjs +1 -0
  56. package/dist/index-MQH3blB-.cjs +1 -0
  57. package/dist/{index-QGA4ayU7.js → index-MaXiXghQ.js} +246 -246
  58. package/dist/index-YpnaudSM.js +63 -0
  59. package/dist/index-ecnGWzh9.cjs +1 -0
  60. package/dist/{index-nrRnwUaC.js → index-eyVVbA05.js} +22843 -25118
  61. package/dist/index-ugsWasKp.js +2202 -0
  62. package/dist/lib.cjs +1 -1
  63. package/dist/lib.js +5 -5
  64. package/dist/{page-viewer-U7o88VvR.js → page-viewer-P5Im9RfR.js} +11 -11
  65. package/dist/page-viewer-Xj9v8mji.cjs +1 -0
  66. package/dist/project-general-setting--5DT1RoW.cjs +1 -0
  67. package/dist/{project-general-setting-h0TeKYRf.js → project-general-setting-R3pVVXmY.js} +11 -10
  68. package/dist/project-seo-setting-3DzzF83_.cjs +1 -0
  69. package/dist/{project-seo-setting-Sl6AE-Q7.js → project-seo-setting-pGpm3-6U.js} +7 -7
  70. package/dist/render.cjs +1 -1
  71. package/dist/render.js +2 -2
  72. package/dist/{single-page-detail-a8zY-XHs.js → single-page-detail-m-THVQnz.js} +43 -42
  73. package/dist/single-page-detail-nJzGUDym.cjs +1 -0
  74. package/dist/studio.cjs +1 -1
  75. package/dist/studio.d.ts +13 -0
  76. package/dist/studio.js +7 -7
  77. package/dist/ui.cjs +1 -1
  78. package/dist/ui.d.ts +4 -4
  79. package/dist/ui.js +50 -50
  80. package/dist/useAddBlockByDrop-6qaL4Ufz.cjs +1 -0
  81. package/dist/useAddBlockByDrop-vGme3brY.js +20 -0
  82. package/dist/web-blocks.cjs +1 -1
  83. package/dist/web-blocks.js +4 -3
  84. package/package.json +1 -1
  85. package/dist/AddBlocks-IE14csoo.js +0 -224
  86. package/dist/AddBlocks-OpGQyVQZ.cjs +0 -1
  87. package/dist/BrandingOptions-tBWzqas5.cjs +0 -1
  88. package/dist/CurrentPage--ag-4O2R.cjs +0 -1
  89. package/dist/Layers-05Ut4xZA.cjs +0 -1
  90. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  91. package/dist/PagesPanel-TLVCJtcF.cjs +0 -1
  92. package/dist/ProjectPanel-Q8sNFs1f.cjs +0 -1
  93. package/dist/Settings-9iryF0yE.cjs +0 -1
  94. package/dist/SidePanels-4zpCzCM6.js +0 -352
  95. package/dist/SidePanels-LVED6uuT.cjs +0 -1
  96. package/dist/Topbar-iH2L4pe0.cjs +0 -1
  97. package/dist/Topbar-ryFhl-PC.js +0 -114
  98. package/dist/UploadImages-VBiO6lqp.cjs +0 -1
  99. package/dist/add-page-modal-KixvLXAG.cjs +0 -1
  100. package/dist/delete-page-modal-6GxLQkEk.cjs +0 -1
  101. package/dist/empty-slot-2LSrWJaY.cjs +0 -1
  102. package/dist/index-ERorPL9q.cjs +0 -1
  103. package/dist/index-xJ8LmB04.cjs +0 -206
  104. package/dist/page-viewer-Nn__90Uo.cjs +0 -1
  105. package/dist/project-general-setting-C98_GooL.cjs +0 -1
  106. package/dist/project-seo-setting-8oJUrOqk.cjs +0 -1
  107. package/dist/single-page-detail-RYI1ukX6.cjs +0 -1
  108. package/dist/useAddBlockByDrop-LBgi6GL7.cjs +0 -1
  109. package/dist/useAddBlockByDrop-Y-g4O8UC.js +0 -20
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("@radix-ui/react-icons"),i=require("react"),_=require("jotai"),u=require("lodash-es"),s=require("./index-MQH3blB-.cjs"),R=require("lucide-react"),D=require("@chaibuilder/runtime"),f=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),K=require("./index-0JU8vPT_.cjs"),S=require("./Functions-N3yhPYKY.cjs"),l=require("./MODIFIERS-9EwxLM8V.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const I=({provider:t,onClose:a})=>{const{t:n}=f.useTranslation(),[o,h]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(c=>h(c))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:m=>m?"":a(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[n("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(K.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:o,shouldExpandNode:w.allExpanded,style:{...w.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function C({children:t,name:a,onRemove:n}){const{t:o}=f.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:o("remove_provider_confirmation").replace("{name}",a)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:o("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:o("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:o("remove")})]})]})]})}const P=()=>{const{t}=f.useTranslation(),a=i.useMemo(()=>D.getChaiDataProviders(),[]),[n,o]=s.usePageDataProviders(),[,h]=_.useAtom(s.pageSyncStateAtom),[m,c]=i.useState(u.filter(a,r=>u.map(n,"providerKey").includes(r.providerKey))),[b,E]=i.useState(""),[g,d]=i.useState(null),N=u.filter(a.map(r=>u.map(m,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),y=r=>{const p=u.find(a,{providerKey:r});c(j=>[...j,p]),o(j=>[...j,{providerKey:p.providerKey,args:{}}]),E(""),h("UNSAVED")},x=r=>{c(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),o(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),h("UNSAVED")},v=r=>d(r);return u.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:b,onValueChange:r=>y(r),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:t("choose")}),N.map(r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${m.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[t("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:m.map(r=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:r.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:r.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>v(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(C,{onRemove:()=>x(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(I,{onClose:()=>d(null),provider:g})]})]})},O=()=>{const{t}=f.useTranslation(),a={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},n={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx(s.Button,{size:"sm",className:"w-10",variant:"outline",children:e.jsxRuntimeExports.jsx(q.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(a).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(o)}),e.jsxRuntimeExports.jsx("div",{children:t(a[o])})]}))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(n).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(o)}),e.jsxRuntimeExports.jsx("div",{children:t(n[o])})]}))})]})})]})]})},L=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-7TF41ISQ.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./Outline-g4TXJ-hK.cjs"))),A=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-uKE1vuWd.cjs"))),U=i.lazy(()=>Promise.resolve().then(()=>require("./index-MQH3blB-.cjs")).then(t=>t.ImagesPanel));let k=null;const B=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),a=s.useBuilderProp("sideBarComponents.bottom",[]),[n,o]=_.useAtom(s.activePanelAtom),[h,m]=i.useState(n),[c,b]=i.useState(null),{t:E}=f.useTranslation(),g={"add-blocks":L,[l.OUTLINE_KEY]:T,"branding-options":A,images:U};u.each(t,({name:x,panel:v})=>{g[x]=v});const d=x=>{clearTimeout(k),n!==l.OUTLINE_KEY&&x===l.OUTLINE_KEY?k=setTimeout(()=>o(l.OUTLINE_KEY),500):m(x),o(x)},N=s.useBuilderProp("dataBindingSupport",!1);function y(){const x=setTimeout(()=>{c&&(d(l.OUTLINE_KEY),clearTimeout(c))},500);b(x)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:y,onClick:()=>d(l.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{d("add-blocks")},size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(q.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(l.OUTLINE_KEY),size:"sm",variant:n===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("branding-options"),size:"sm",variant:n==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(q.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:x,icon:v})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(x),size:"sm",className:"w-10",variant:n===x?"default":"outline",children:e.jsxRuntimeExports.jsx(v,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(O,{}),i.Children.toArray(a.map(x=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(x,{})})))]})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${n!==l.OUTLINE_KEY?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:S.cn("relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",n===l.OUTLINE_KEY?"":"z-[100]"),onMouseEnter:()=>{c&&clearTimeout(c)},children:i.createElement(u.get(g,n,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:N?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(R.DatabaseIcon,{className:"mr-2 w-3"}),E("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(P,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)})]})})})})]})};exports.default=B;
@@ -0,0 +1,389 @@
1
+ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
+ import { KeyboardIcon as U, PlusIcon as J, Half2Icon as q } from "@radix-ui/react-icons";
3
+ import j, { useState as p, useEffect as Y, useMemo as Z, lazy as w, Suspense as y } from "react";
4
+ import { useAtom as M } from "jotai";
5
+ import { filter as N, map as K, isNull as $, find as G, isEmpty as Q, each as W, get as X } from "lodash-es";
6
+ import { ad as H, ae as F, af as L, ag as R, ah as ee, A as se, a as re, b as le, c as ae, d as ie, e as te, f as oe, g as ne, ai as ce, y as de, C as me, aj as xe, ak as pe, al as he, am as ue, an as E, ao as fe, ap as je, aq as ve, B as v, ar as ge, as as B, h as T, at as be, S as z, au as V, av as O, aw as S, ax as _ } from "./index-MaXiXghQ.js";
7
+ import { ListTreeIcon as A, DatabaseIcon as ye } from "lucide-react";
8
+ import { getChaiDataProviders as Ne } from "@chaibuilder/runtime";
9
+ import { useTranslation as g } from "react-i18next";
10
+ import { J as we, a as ke, d as Ce } from "./index-e0c8PmRQ.js";
11
+ import { E as De } from "./index-eyVVbA05.js";
12
+ import { c as Te } from "./Functions-7jnEwJyw.js";
13
+ import { O as i } from "./MODIFIERS-WQdaNvb8.js";
14
+ import "./_commonjsHelpers-UyOWmZb0.js";
15
+ import "flat-to-nested";
16
+ import "@react-hookz/web";
17
+ import "@radix-ui/react-toggle";
18
+ import "class-variance-authority";
19
+ import "./Class-3k8xjeiM.js";
20
+ import "clsx";
21
+ import "tailwind-merge";
22
+ import "@radix-ui/react-switch";
23
+ import "@radix-ui/react-slot";
24
+ import "@radix-ui/react-accordion";
25
+ import "@radix-ui/react-alert-dialog";
26
+ import "@radix-ui/react-dialog";
27
+ import "@radix-ui/react-label";
28
+ import "@radix-ui/react-scroll-area";
29
+ import "@radix-ui/react-tabs";
30
+ import "@radix-ui/react-tooltip";
31
+ import "@radix-ui/react-popover";
32
+ import "@radix-ui/react-menubar";
33
+ import "@radix-ui/react-hover-card";
34
+ import "@radix-ui/react-select";
35
+ import "@radix-ui/react-dropdown-menu";
36
+ import "@radix-ui/react-separator";
37
+ import "@radix-ui/react-toast";
38
+ import "cmdk";
39
+ import "@radix-ui/react-context-menu";
40
+ import "react-icons-picker";
41
+ import "react-dom";
42
+ import "react-quill";
43
+ import "i18next";
44
+ import "@floating-ui/react-dom";
45
+ import "react-textarea-autosize";
46
+ import "flagged";
47
+ import "react-dnd";
48
+ import "@minoru/react-dnd-treeview";
49
+ import "react-hotkeys-hook";
50
+ const Se = ({ provider: s, onClose: o }) => {
51
+ const { t: l } = g(), [a, h] = p(null);
52
+ return Y(() => {
53
+ s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => h(n));
54
+ }, [s]), s ? /* @__PURE__ */ e.jsx(H, { onOpenChange: (d) => d ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(F, { children: [
55
+ /* @__PURE__ */ e.jsxs(L, { children: [
56
+ /* @__PURE__ */ e.jsxs(R, { children: [
57
+ l("data_provider"),
58
+ ": ",
59
+ s.name
60
+ ] }),
61
+ /* @__PURE__ */ e.jsx(ee, { children: s.description })
62
+ ] }),
63
+ /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(
64
+ we,
65
+ {
66
+ data: a,
67
+ shouldExpandNode: ke,
68
+ style: {
69
+ ...Ce,
70
+ container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
71
+ stringValue: "text-orange-600",
72
+ label: "text-green-900 font-semibold pr-1 tracking-wider"
73
+ }
74
+ }
75
+ ) })
76
+ ] }) }) : null;
77
+ };
78
+ function _e({
79
+ children: s,
80
+ name: o,
81
+ onRemove: l
82
+ }) {
83
+ const { t: a } = g();
84
+ return /* @__PURE__ */ e.jsxs(se, { children: [
85
+ /* @__PURE__ */ e.jsx(re, { asChild: !0, children: s }),
86
+ /* @__PURE__ */ e.jsxs(le, { children: [
87
+ /* @__PURE__ */ e.jsxs(ae, { children: [
88
+ /* @__PURE__ */ e.jsx(
89
+ ie,
90
+ {
91
+ dangerouslySetInnerHTML: { __html: a("remove_provider_confirmation").replace("{name}", o) }
92
+ }
93
+ ),
94
+ /* @__PURE__ */ e.jsx(te, { children: a("remove_provider_warning") })
95
+ ] }),
96
+ /* @__PURE__ */ e.jsxs(oe, { children: [
97
+ /* @__PURE__ */ e.jsx(ne, { children: a("cancel") }),
98
+ /* @__PURE__ */ e.jsx(ce, { onClick: l, className: "bg-red-600 hover:bg-red-700", children: a("remove") })
99
+ ] })
100
+ ] })
101
+ ] });
102
+ }
103
+ const Ae = () => {
104
+ const { t: s } = g(), o = Z(() => Ne(), []), [l, a] = de(), [, h] = M(me), [d, n] = p(
105
+ N(o, (r) => K(l, "providerKey").includes(r.providerKey))
106
+ ), [k, u] = p(""), [b, c] = p(null), C = N(
107
+ o.map((r) => K(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
108
+ (r) => !$(r)
109
+ ), D = (r) => {
110
+ const x = G(o, { providerKey: r });
111
+ n((m) => [...m, x]), a((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""), h("UNSAVED");
112
+ }, t = (r) => {
113
+ n((x) => N(x, (m) => m.providerKey !== r.providerKey)), a((x) => N(x, (m) => m.providerKey !== r.providerKey)), h("UNSAVED");
114
+ }, f = (r) => c(r);
115
+ return Q(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
116
+ s("no_data_providers"),
117
+ /* @__PURE__ */ e.jsx("br", {}),
118
+ /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
119
+ ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
120
+ /* @__PURE__ */ e.jsx("br", {}),
121
+ /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
122
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(xe, { value: k, onValueChange: (r) => D(r), children: [
123
+ /* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(he, { placeholder: s("select_provider") }) }),
124
+ /* @__PURE__ */ e.jsxs(ue, { children: [
125
+ /* @__PURE__ */ e.jsx(E, { value: "", children: s("choose") }),
126
+ C.map((r) => /* @__PURE__ */ e.jsx(E, { value: r.value, children: r.label }, r.value))
127
+ ] })
128
+ ] }) }),
129
+ /* @__PURE__ */ e.jsx("br", {}),
130
+ /* @__PURE__ */ e.jsxs("div", { className: `border-t ${d.length ? "block" : "hidden"}`, children: [
131
+ /* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
132
+ s("page_data_providers"),
133
+ ":"
134
+ ] }),
135
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: d.map((r) => /* @__PURE__ */ e.jsxs(
136
+ "div",
137
+ {
138
+ className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
139
+ "data-v0-t": "card",
140
+ children: [
141
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-1.5 px-4 pt-4", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsxs("div", { children: [
142
+ /* @__PURE__ */ e.jsx("h3", { className: "font-medium leading-4", children: r.name }),
143
+ /* @__PURE__ */ e.jsx("p", { className: "pt-1 text-xs text-gray-400", children: r.description })
144
+ ] }) }) }),
145
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-2 py-2", children: [
146
+ /* @__PURE__ */ e.jsxs(
147
+ "button",
148
+ {
149
+ onClick: () => f(r),
150
+ className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
151
+ children: [
152
+ /* @__PURE__ */ e.jsxs(
153
+ "svg",
154
+ {
155
+ xmlns: "http://www.w3.org/2000/svg",
156
+ width: "24",
157
+ height: "24",
158
+ viewBox: "0 0 24 24",
159
+ fill: "none",
160
+ stroke: "currentColor",
161
+ "stroke-width": "2",
162
+ "stroke-linecap": "round",
163
+ "stroke-linejoin": "round",
164
+ className: "mr-2 h-4 w-4",
165
+ children: [
166
+ /* @__PURE__ */ e.jsx("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
167
+ /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" })
168
+ ]
169
+ }
170
+ ),
171
+ s("view_data")
172
+ ]
173
+ }
174
+ ),
175
+ /* @__PURE__ */ e.jsx(_e, { onRemove: () => t(r), name: r.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
176
+ /* @__PURE__ */ e.jsxs(
177
+ "svg",
178
+ {
179
+ xmlns: "http://www.w3.org/2000/svg",
180
+ width: "24",
181
+ height: "24",
182
+ viewBox: "0 0 24 24",
183
+ fill: "none",
184
+ stroke: "currentColor",
185
+ "stroke-width": "2",
186
+ "stroke-linecap": "round",
187
+ "stroke-linejoin": "round",
188
+ className: "mr-2 h-4 w-4",
189
+ children: [
190
+ /* @__PURE__ */ e.jsx("path", { d: "M3 6h18" }),
191
+ /* @__PURE__ */ e.jsx("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
192
+ /* @__PURE__ */ e.jsx("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
193
+ ]
194
+ }
195
+ ),
196
+ s("remove")
197
+ ] }) })
198
+ ] })
199
+ ]
200
+ },
201
+ r.providerKey
202
+ )) }),
203
+ /* @__PURE__ */ e.jsx(Se, { onClose: () => c(null), provider: b })
204
+ ] })
205
+ ] });
206
+ }, Pe = () => {
207
+ const { t: s } = g(), o = {
208
+ "ctrl + Z": "Undo",
209
+ "ctrl + Y": "Redo",
210
+ "ctrl + D": "Duplicate"
211
+ }, l = {
212
+ // "ctrl + /": "Rename block",
213
+ "ctrl + S": "Save page",
214
+ esc: "Deselect blocks",
215
+ del: "Delete block"
216
+ };
217
+ return /* @__PURE__ */ e.jsxs(H, { children: [
218
+ /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(je, { children: [
219
+ /* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsx(v, { size: "sm", className: "w-10", variant: "outline", children: /* @__PURE__ */ e.jsx(U, {}) }) }),
220
+ /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
221
+ ] }) }),
222
+ /* @__PURE__ */ e.jsxs(F, { className: "sm:max-w-[525px]", children: [
223
+ /* @__PURE__ */ e.jsx(L, { children: /* @__PURE__ */ e.jsx(R, { children: s("Keyboard shortcuts") }) }),
224
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
225
+ /* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
226
+ /* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
227
+ /* @__PURE__ */ e.jsx("div", { children: s(o[a]) })
228
+ ] })) }),
229
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(l).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
230
+ /* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
231
+ /* @__PURE__ */ e.jsx("div", { children: s(l[a]) })
232
+ ] })) })
233
+ ] }) })
234
+ ] })
235
+ ] });
236
+ }, Ke = w(() => import("./AddBlocks--SllKzEG.js")), P = w(() => import("./Outline-3IPrK7F-.js")), Ee = w(() => import("./BrandingOptions-IqtZrxqX.js")), Be = w(() => import("./index-MaXiXghQ.js").then((s) => s.cq));
237
+ let I = null;
238
+ const As = () => {
239
+ const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = M(be), [h, d] = p(l), [n, k] = p(null), { t: u } = g(), b = {
240
+ "add-blocks": Ke,
241
+ [i]: P,
242
+ "branding-options": Ee,
243
+ images: Be
244
+ };
245
+ W(s, ({ name: t, panel: f }) => {
246
+ b[t] = f;
247
+ });
248
+ const c = (t) => {
249
+ clearTimeout(I), l !== i && t === i ? I = setTimeout(() => a(i), 500) : d(t), a(t);
250
+ }, C = T("dataBindingSupport", !1);
251
+ function D() {
252
+ const t = setTimeout(() => {
253
+ n && (c(i), clearTimeout(n));
254
+ }, 500);
255
+ k(t);
256
+ }
257
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
258
+ l !== i ? /* @__PURE__ */ e.jsx(
259
+ "div",
260
+ {
261
+ onMouseEnter: D,
262
+ onClick: () => c(i),
263
+ className: "fixed inset-0 z-[50] bg-black/20"
264
+ }
265
+ ) : null,
266
+ /* @__PURE__ */ e.jsxs("div", { className: "z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2", children: [
267
+ /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
268
+ /* @__PURE__ */ e.jsx(
269
+ v,
270
+ {
271
+ onClick: () => {
272
+ c("add-blocks");
273
+ },
274
+ size: "sm",
275
+ variant: l === "add-blocks" ? "default" : "outline",
276
+ children: /* @__PURE__ */ e.jsx(J, { className: "text-xl" })
277
+ }
278
+ ),
279
+ /* @__PURE__ */ e.jsx(
280
+ v,
281
+ {
282
+ onClick: () => c(i),
283
+ size: "sm",
284
+ variant: l === i ? "default" : "outline",
285
+ children: /* @__PURE__ */ e.jsx(A, { className: "w-4" })
286
+ }
287
+ ),
288
+ /* @__PURE__ */ e.jsx(
289
+ v,
290
+ {
291
+ onClick: () => c("branding-options"),
292
+ size: "sm",
293
+ variant: l === "branding-options" ? "default" : "outline",
294
+ children: /* @__PURE__ */ e.jsx(q, { className: "w-4 max-w-[40px] text-xs" })
295
+ }
296
+ ),
297
+ j.Children.toArray(
298
+ s.map(({ name: t, icon: f }) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
299
+ v,
300
+ {
301
+ onClick: () => c(t),
302
+ size: "sm",
303
+ className: "w-10",
304
+ variant: l === t ? "default" : "outline",
305
+ children: /* @__PURE__ */ e.jsx(f, {})
306
+ }
307
+ ) }))
308
+ )
309
+ ] }),
310
+ /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
311
+ /* @__PURE__ */ e.jsx(Pe, {}),
312
+ j.Children.toArray(
313
+ o.map((t) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
314
+ )
315
+ ] })
316
+ ] }),
317
+ /* @__PURE__ */ e.jsx(
318
+ "div",
319
+ {
320
+ className: `absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${l !== i ? "translate-x-0" : "-translate-x-full"}`,
321
+ children: /* @__PURE__ */ e.jsx(
322
+ y,
323
+ {
324
+ fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
325
+ /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
326
+ /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
327
+ /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
328
+ ] }),
329
+ children: /* @__PURE__ */ e.jsx(
330
+ "div",
331
+ {
332
+ className: Te(
333
+ "relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",
334
+ l === i ? "" : "z-[100]"
335
+ ),
336
+ onMouseEnter: () => {
337
+ n && clearTimeout(n);
338
+ },
339
+ children: j.createElement(X(b, l, () => /* @__PURE__ */ e.jsx("div", {})))
340
+ }
341
+ )
342
+ }
343
+ )
344
+ }
345
+ ),
346
+ /* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
347
+ y,
348
+ {
349
+ fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
350
+ /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
351
+ /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
352
+ /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
353
+ ] }),
354
+ children: C ? /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
355
+ /* @__PURE__ */ e.jsxs(O, { className: "mx-1 grid h-10 grid-cols-2", children: [
356
+ /* @__PURE__ */ e.jsxs(S, { value: i, children: [
357
+ /* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
358
+ " ",
359
+ u("Outline")
360
+ ] }),
361
+ /* @__PURE__ */ e.jsxs(S, { value: "data-provider", children: [
362
+ /* @__PURE__ */ e.jsx(ye, { className: "mr-2 w-3" }),
363
+ u("Data")
364
+ ] })
365
+ ] }),
366
+ /* @__PURE__ */ e.jsx(_, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: j.createElement(P) }),
367
+ /* @__PURE__ */ e.jsx(_, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ae, {}) })
368
+ ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
369
+ /* @__PURE__ */ e.jsx(O, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(S, { value: i, children: [
370
+ /* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
371
+ " ",
372
+ u("Outline")
373
+ ] }) }),
374
+ /* @__PURE__ */ e.jsx(
375
+ _,
376
+ {
377
+ value: i,
378
+ className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
379
+ children: j.createElement(P)
380
+ }
381
+ )
382
+ ] }) })
383
+ }
384
+ ) })
385
+ ] });
386
+ };
387
+ export {
388
+ As as default
389
+ };
@@ -0,0 +1,129 @@
1
+ import { j as c } from "./jsx-runtime-WbnYoNE9.js";
2
+ import z, { useMemo as V, Suspense as n } from "react";
3
+ import { FontFamilyIcon as o, EyeOpenIcon as M } from "@radix-ui/react-icons";
4
+ import { h as s, aj as u, ak as d, al as C, am as L, ay as m, az as p, an as i, z as F, B as g, q as w, S as v, aA as B } from "./index-MaXiXghQ.js";
5
+ import { G as f } from "./index-YpnaudSM.js";
6
+ import { useTranslation as e } from "react-i18next";
7
+ import "./_commonjsHelpers-UyOWmZb0.js";
8
+ import "lodash-es";
9
+ import "./Functions-7jnEwJyw.js";
10
+ import "clsx";
11
+ import "tailwind-merge";
12
+ import "@chaibuilder/runtime";
13
+ import "jotai";
14
+ import "flat-to-nested";
15
+ import "./MODIFIERS-WQdaNvb8.js";
16
+ import "@react-hookz/web";
17
+ import "@radix-ui/react-toggle";
18
+ import "class-variance-authority";
19
+ import "./Class-3k8xjeiM.js";
20
+ import "@radix-ui/react-switch";
21
+ import "@radix-ui/react-slot";
22
+ import "@radix-ui/react-accordion";
23
+ import "@radix-ui/react-alert-dialog";
24
+ import "@radix-ui/react-dialog";
25
+ import "@radix-ui/react-label";
26
+ import "@radix-ui/react-scroll-area";
27
+ import "@radix-ui/react-tabs";
28
+ import "@radix-ui/react-tooltip";
29
+ import "@radix-ui/react-popover";
30
+ import "@radix-ui/react-menubar";
31
+ import "@radix-ui/react-hover-card";
32
+ import "@radix-ui/react-select";
33
+ import "@radix-ui/react-dropdown-menu";
34
+ import "@radix-ui/react-separator";
35
+ import "@radix-ui/react-toast";
36
+ import "cmdk";
37
+ import "@radix-ui/react-context-menu";
38
+ import "react-icons-picker";
39
+ import "react-dom";
40
+ import "react-quill";
41
+ const x = () => s("languages", ["en"]), S = () => x().length === 1 ? null : /* @__PURE__ */ c.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ c.jsxs(u, { children: [
42
+ /* @__PURE__ */ c.jsx(d, { className: "w-[150px] border-0", children: /* @__PURE__ */ c.jsx(
43
+ C,
44
+ {
45
+ placeholder: /* @__PURE__ */ c.jsxs("span", { className: "flex items-center", children: [
46
+ /* @__PURE__ */ c.jsx(o, { className: "h-4 w-4" }),
47
+ " English(US)"
48
+ ] })
49
+ }
50
+ ) }),
51
+ /* @__PURE__ */ c.jsx(L, { children: /* @__PURE__ */ c.jsxs(m, { children: [
52
+ /* @__PURE__ */ c.jsx(p, { children: "Fruits" }),
53
+ /* @__PURE__ */ c.jsx(i, { value: "apple", children: "Apple" }),
54
+ /* @__PURE__ */ c.jsx(i, { value: "banana", children: "Banana" }),
55
+ /* @__PURE__ */ c.jsx(i, { value: "blueberry", children: "Blueberry" }),
56
+ /* @__PURE__ */ c.jsx(i, { value: "grapes", children: "Grapes" }),
57
+ /* @__PURE__ */ c.jsx(i, { value: "pineapple", children: "Pineapple" })
58
+ ] }) })
59
+ ] }) });
60
+ function A(l) {
61
+ return f({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z" } }] })(l);
62
+ }
63
+ const R = () => {
64
+ const { savePage: l, syncState: t } = F(), { t: r } = e(), h = V(() => {
65
+ switch (t) {
66
+ case "SAVING":
67
+ return "animate-pulse bg-gray-300 text-gray-900";
68
+ case "SAVED":
69
+ return "bg-green-500 text-white hover:bg-green-600 hover:text-white";
70
+ default:
71
+ return "bg-gray-200 text-gray-500 hover:bg-gray-100";
72
+ }
73
+ }, [t]), a = /* @__PURE__ */ c.jsxs(
74
+ g,
75
+ {
76
+ disabled: t === "SAVING",
77
+ onClick: (H) => {
78
+ H.preventDefault(), l();
79
+ },
80
+ className: `flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${h}`,
81
+ size: "sm",
82
+ variant: "outline",
83
+ children: [
84
+ /* @__PURE__ */ c.jsx(A, { className: "text-lg" }),
85
+ /* @__PURE__ */ c.jsx("span", { className: "text-sm", children: t === "SAVING" ? "Saving..." : r(t === "SAVED" ? "Saved" : "Unsaved") })
86
+ ]
87
+ }
88
+ );
89
+ return /* @__PURE__ */ c.jsx("div", { className: "flex items-center", children: a });
90
+ }, k = function() {
91
+ const t = s("previewComponent"), [, r] = w(), { t: h } = e();
92
+ return t ? /* @__PURE__ */ c.jsxs(
93
+ g,
94
+ {
95
+ onClick: (a) => {
96
+ a.preventDefault(), r(!0);
97
+ },
98
+ className: "flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",
99
+ size: "sm",
100
+ variant: "outline",
101
+ children: [
102
+ /* @__PURE__ */ c.jsx(M, { className: "text-xs" }),
103
+ /* @__PURE__ */ c.jsx("span", { className: "text-sm", children: h("Preview") })
104
+ ]
105
+ }
106
+ ) : null;
107
+ }, d1 = () => {
108
+ const l = s("topBarComponents.left", []), t = s("topBarComponents.center", []), r = s("topBarComponents.right", []), h = s("editable", !0);
109
+ return /* @__PURE__ */ c.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
110
+ /* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2 font-bold", children: z.Children.toArray(
111
+ l.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
112
+ ) }) }),
113
+ /* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2", children: z.Children.toArray(
114
+ t.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
115
+ ) }),
116
+ /* @__PURE__ */ c.jsxs("div", { className: "flex items-center space-x-2", children: [
117
+ /* @__PURE__ */ c.jsx(S, {}),
118
+ /* @__PURE__ */ c.jsx(k, {}),
119
+ /* @__PURE__ */ c.jsx(B, { orientation: "vertical" }),
120
+ h ? /* @__PURE__ */ c.jsx(R, {}) : null,
121
+ z.Children.toArray(
122
+ r.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
123
+ )
124
+ ] })
125
+ ] });
126
+ };
127
+ export {
128
+ d1 as default
129
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),h=require("@radix-ui/react-icons"),t=require("./index-MQH3blB-.cjs"),z=require("./index-ecnGWzh9.cjs"),i=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");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");const v=()=>t.useBuilderProp("languages",["en"]),g=()=>v().length===1?null:c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:c.jsxRuntimeExports.jsxs(t.Select,{children:[c.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"w-[150px] border-0",children:c.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:c.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[c.jsxRuntimeExports.jsx(h.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),c.jsxRuntimeExports.jsx(t.SelectContent,{children:c.jsxRuntimeExports.jsxs(t.SelectGroup,{children:[c.jsxRuntimeExports.jsx(t.SelectLabel,{children:"Fruits"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"apple",children:"Apple"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"banana",children:"Banana"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"blueberry",children:"Blueberry"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"grapes",children:"Grapes"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})});function H(l){return z.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(l)}const V=()=>{const{savePage:l,syncState:a}=t.useSavePage(),{t:s}=i.useTranslation(),e=r.useMemo(()=>{switch(a){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[a]),n=c.jsxRuntimeExports.jsxs(t.Button,{disabled:a==="SAVING",onClick:o=>{o.preventDefault(),l()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${e}`,size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(H,{className:"text-lg"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:a==="SAVING"?"Saving...":s(a==="SAVED"?"Saved":"Unsaved")})]});return c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:n})},M=function(){const a=t.useBuilderProp("previewComponent"),[,s]=t.usePreviewMode(),{t:e}=i.useTranslation();return a?c.jsxRuntimeExports.jsxs(t.Button,{onClick:n=>{n.preventDefault(),s(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(h.EyeOpenIcon,{className:"text-xs"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:e("Preview")})]}):null},u=()=>{const l=t.useBuilderProp("topBarComponents.left",[]),a=t.useBuilderProp("topBarComponents.center",[]),s=t.useBuilderProp("topBarComponents.right",[]),e=t.useBuilderProp("editable",!0);return c.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:r.Children.toArray(l.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))})}),c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:r.Children.toArray(a.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))}),c.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsxRuntimeExports.jsx(g,{}),c.jsxRuntimeExports.jsx(M,{}),c.jsxRuntimeExports.jsx(t.Separator,{orientation:"vertical"}),e?c.jsxRuntimeExports.jsx(V,{}):null,r.Children.toArray(s.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=u;
@@ -2,10 +2,10 @@ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import { useState as p, useEffect as D } from "react";
3
3
  import { isEmpty as d, startCase as E } from "lodash-es";
4
4
  import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
5
- import { createApi as U } from "unsplash-js";
6
- import { i as V, bc as B, aT as F, aU as K, aV as O, aj as P, ak as C, al as S, am as k, an as h, bf as Q, B as H } from "./index-QGA4ayU7.js";
5
+ import { createApi as V } from "unsplash-js";
6
+ import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h, bg as Q, B as H } from "./index-MaXiXghQ.js";
7
7
  import { useDebouncedState as R } from "@react-hookz/web";
8
- import { Loader as $ } from "lucide-react";
8
+ import { Loader as W } from "lucide-react";
9
9
  import "./_commonjsHelpers-UyOWmZb0.js";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
@@ -13,10 +13,10 @@ import "tailwind-merge";
13
13
  import "@chaibuilder/runtime";
14
14
  import "jotai";
15
15
  import "flat-to-nested";
16
- import "./MODIFIERS-RiXS5Mn1.js";
16
+ import "./MODIFIERS-WQdaNvb8.js";
17
17
  import "@radix-ui/react-toggle";
18
18
  import "class-variance-authority";
19
- import "./Class-17XFhL48.js";
19
+ import "./Class-3k8xjeiM.js";
20
20
  import "@radix-ui/react-switch";
21
21
  import "@radix-ui/react-slot";
22
22
  import "@radix-ui/react-accordion";
@@ -40,11 +40,11 @@ import "react-dom";
40
40
  import "react-quill";
41
41
  import "react-i18next";
42
42
  const I = async (x, g) => new Promise((o, r) => {
43
- U({ accessKey: g }).search.getPhotos(x).then((i) => {
43
+ V({ accessKey: g }).search.getPhotos(x).then((i) => {
44
44
  o(i);
45
45
  }).catch((i) => r(i));
46
46
  }), De = ({ isModalView: x, onSelect: g }) => {
47
- const o = V("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [T, y] = p(0), [u, z] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
47
+ const o = B("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
48
48
  if (d(u))
49
49
  return;
50
50
  let t = i + 1;
@@ -83,17 +83,17 @@ const I = async (x, g) => new Promise((o, r) => {
83
83
  ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
84
84
  /* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
85
85
  /* @__PURE__ */ e.jsx(
86
- B,
86
+ F,
87
87
  {
88
88
  type: "text",
89
89
  name: "query",
90
90
  className: "input",
91
91
  placeholder: 'Try "dog" or "apple"',
92
- onChange: (s) => z(s.target.value)
92
+ onChange: (s) => T(s.target.value)
93
93
  }
94
94
  ),
95
- /* @__PURE__ */ e.jsxs(F, { children: [
96
- /* @__PURE__ */ e.jsx(K, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
95
+ /* @__PURE__ */ e.jsxs(K, { children: [
96
+ /* @__PURE__ */ e.jsx(U, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
97
97
  /* @__PURE__ */ e.jsx(
98
98
  O,
99
99
  {
@@ -173,10 +173,10 @@ const I = async (x, g) => new Promise((o, r) => {
173
173
  ) }) }, s.id)
174
174
  )),
175
175
  f && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-8", children: [
176
- /* @__PURE__ */ e.jsx($, { className: "animate-spin w-6 h-6" }),
176
+ /* @__PURE__ */ e.jsx(W, { className: "animate-spin w-6 h-6" }),
177
177
  "  Loading..."
178
178
  ] }),
179
- !d(r) && i < T && !f && /* @__PURE__ */ e.jsx(
179
+ !d(r) && i < z && !f && /* @__PURE__ */ e.jsx(
180
180
  H,
181
181
  {
182
182
  size: "sm",