@chaibuilder/sdk 1.2.25 → 1.2.27

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 (183) hide show
  1. package/dist/AddBlocks-S-4jzdWv.cjs +1 -0
  2. package/dist/AddBlocks-ksZjjn0k.js +205 -0
  3. package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
  4. package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-T_kbQFQv.js} +53 -40
  5. package/dist/CanvasArea-SDzbubar.cjs +55 -0
  6. package/dist/{CanvasArea-dZjng782.js → CanvasArea-rhOeubmu.js} +323 -340
  7. package/dist/{Class-ahc3NIbq.js → Class-3k8xjeiM.js} +29 -26
  8. package/dist/Class-MmCxz2Ay.cjs +1 -0
  9. package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-0eeU1V_c.js} +53 -40
  10. package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
  11. package/dist/Functions-7jnEwJyw.js +15 -0
  12. package/dist/Functions-N3yhPYKY.cjs +1 -0
  13. package/dist/{ListTree-N3jeD790.js → ListTree-Muu4rAtp.js} +96 -87
  14. package/dist/ListTree-SWsqdfcG.cjs +1 -0
  15. package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
  16. package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-WQdaNvb8.js} +8 -10
  17. package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
  18. package/dist/{PagesPanel-u1IB-nRr.js → PagesPanel-rYN28QpN.js} +44 -29
  19. package/dist/ProjectPanel-ivFOhdcz.js +84 -0
  20. package/dist/ProjectPanel-pBePMOta.cjs +1 -0
  21. package/dist/Settings-JRyJayf5.cjs +1 -0
  22. package/dist/{Settings-jCcd-VE6.js → Settings-XWmKzRl9.js} +400 -407
  23. package/dist/SidePanels-BtUeo6M9.cjs +1 -0
  24. package/dist/{SidePanels-pHMYprpW.js → SidePanels-ODktnGbC.js} +117 -108
  25. package/dist/Topbar-QMeD3hvq.cjs +1 -0
  26. package/dist/Topbar-Yunooh00.js +131 -0
  27. package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
  28. package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-QMl0bxix.js} +59 -47
  29. package/dist/UploadImages-OgSN1HVt.cjs +1 -0
  30. package/dist/{UploadImages-zdEJRLD8.js → UploadImages-Si-A26bc.js} +58 -36
  31. package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
  32. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
  33. package/dist/add-page-modal-9pTKItY-.cjs +1 -0
  34. package/dist/add-page-modal-U7AUUrI1.js +103 -0
  35. package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
  36. package/dist/confirm-alert-kV5-c70T.js +59 -0
  37. package/dist/controls-KK2oLIa8.cjs +1 -0
  38. package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.js +74 -150
  41. package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
  42. package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-gunU_Fe5.js} +8 -6
  43. package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
  44. package/dist/delete-page-modal-UCBpdjLe.js +82 -0
  45. package/dist/email-blocks.cjs +1 -1
  46. package/dist/email-blocks.js +292 -3
  47. package/dist/email.cjs +1 -1
  48. package/dist/email.js +36 -18
  49. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  50. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  51. package/dist/form-Ap63cNec.cjs +1 -0
  52. package/dist/{form-0_RLz2TB.js → form-zmlTjM9j.js} +12 -12
  53. package/dist/html-to-json-C_Eobs_d.cjs +1 -0
  54. package/dist/{html-to-json-2xtb7520.js → html-to-json-p__Fgqdg.js} +65 -40
  55. package/dist/index-CFUoB97-.js +3079 -0
  56. package/dist/index-F4AQQ6qq.cjs +1 -0
  57. package/dist/index-Qk028f-N.cjs +1 -0
  58. package/dist/index-YpnaudSM.js +63 -0
  59. package/dist/index-e0c8PmRQ.js +205 -0
  60. package/dist/index-ecnGWzh9.cjs +1 -0
  61. package/dist/index-f0AbmoYY.js +2201 -0
  62. package/dist/index-gi1LIOCw.cjs +1 -0
  63. package/dist/index-l19JVVXI.cjs +206 -0
  64. package/dist/index-lOJfSheQ.js +39503 -0
  65. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
  66. package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
  67. package/dist/lib.cjs +3 -3
  68. package/dist/lib.js +59 -56
  69. package/dist/page-viewer-YFrIG3L7.cjs +1 -0
  70. package/dist/{page-viewer-NnOwmAmu.js → page-viewer-jOwy--9A.js} +56 -43
  71. package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-3N8HZ2fe.js} +42 -35
  72. package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
  73. package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-bSiNgO_1.js} +39 -23
  74. package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
  75. package/dist/render.cjs +1 -1
  76. package/dist/render.js +16 -16
  77. package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail--AZlZ-pC.js} +73 -66
  78. package/dist/single-page-detail-9abF2g2R.cjs +1 -0
  79. package/dist/studio.cjs +1 -1
  80. package/dist/studio.js +39 -24
  81. package/dist/ui.cjs +1 -1
  82. package/dist/ui.js +158 -364
  83. package/dist/web-blocks.cjs +1 -1
  84. package/dist/web-blocks.js +1052 -3
  85. package/package.json +1 -1
  86. package/dist/AddBlocks-Ol3iIVKa.js +0 -207
  87. package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
  88. package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
  89. package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
  90. package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
  91. package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
  92. package/dist/Class-eieto7e-.cjs +0 -1
  93. package/dist/Controls-3Cc1XYXg.js +0 -105
  94. package/dist/Controls-ky25Ebo3.cjs +0 -1
  95. package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
  96. package/dist/Functions-Hvon6AMZ.cjs +0 -1
  97. package/dist/Functions-NzT2Six_.js +0 -15
  98. package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
  99. package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
  100. package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
  101. package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
  102. package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
  103. package/dist/ProjectPanel-EydGZmMW.js +0 -71
  104. package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
  105. package/dist/STRINGS-b432aBJJ.js +0 -7
  106. package/dist/STRINGS-gPz7CUOk.cjs +0 -1
  107. package/dist/Settings-8ilCSH8b.cjs +0 -1
  108. package/dist/SidePanels-T36C6Lhc.cjs +0 -1
  109. package/dist/Topbar-CvWQuspR.cjs +0 -1
  110. package/dist/Topbar-pbIDUE_B.js +0 -122
  111. package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
  112. package/dist/UploadImages-GkkJVAgG.cjs +0 -1
  113. package/dist/accordion-oPUeqPCZ.js +0 -42
  114. package/dist/accordion-ynvFtV_p.cjs +0 -1
  115. package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
  116. package/dist/add-page-modal-JCDXZIPW.js +0 -95
  117. package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
  118. package/dist/alert-dialog-rypfO5ly.js +0 -64
  119. package/dist/badge-E-S7CqUt.cjs +0 -1
  120. package/dist/badge-tEwO7C51.js +0 -23
  121. package/dist/block-helpers-OKHmRRol.cjs +0 -1
  122. package/dist/block-helpers-oSFpSsGz.js +0 -23
  123. package/dist/command-BxR6jaCI.cjs +0 -1
  124. package/dist/command-Pn3HKDuV.js +0 -97
  125. package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
  126. package/dist/confirm-alert-wR5_VJ1l.js +0 -36
  127. package/dist/context-menu-8dC9uGXj.js +0 -122
  128. package/dist/context-menu-IgLbIuth.cjs +0 -1
  129. package/dist/controls-L7DPvB0m.cjs +0 -1
  130. package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
  131. package/dist/delete-page-modal-7KmP1elv.js +0 -67
  132. package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
  133. package/dist/dropdown-menu-El86_9Uo.js +0 -124
  134. package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
  135. package/dist/form-W58AVUdf.cjs +0 -1
  136. package/dist/hover-card-KUwpDkW8.cjs +0 -1
  137. package/dist/hover-card-q138xxXR.js +0 -45
  138. package/dist/html-to-json-uSnxl72F.cjs +0 -1
  139. package/dist/iconBase-gbUAAO2L.cjs +0 -1
  140. package/dist/iconBase-h4DuR_XT.js +0 -63
  141. package/dist/index-9MmykVSc.cjs +0 -1
  142. package/dist/index-hElOGcFr.js +0 -2200
  143. package/dist/index-lDTsQp7h.js +0 -188
  144. package/dist/index-rq5Y9ZDy.cjs +0 -1
  145. package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
  146. package/dist/label-KaP7MRrs.js +0 -10
  147. package/dist/label-tFm8HZdb.cjs +0 -1
  148. package/dist/link-WbcKdQ9k.cjs +0 -1
  149. package/dist/link-xuhP-4dN.js +0 -196
  150. package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
  151. package/dist/popover-a84pbVhQ.js +0 -23
  152. package/dist/popover-fKjgcRUx.cjs +0 -1
  153. package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
  154. package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
  155. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  156. package/dist/scroll-area-ewXbxc3n.js +0 -30
  157. package/dist/select-7bjg-rr9.cjs +0 -1
  158. package/dist/select-POGdEDHT.js +0 -75
  159. package/dist/separator-3Civ-6hb.cjs +0 -1
  160. package/dist/separator-SctTn0Qi.js +0 -18
  161. package/dist/single-page-detail-beY0MT1b.cjs +0 -1
  162. package/dist/skeleton-STeL9VrJ.cjs +0 -1
  163. package/dist/skeleton-lu8e7q2y.js +0 -239
  164. package/dist/tabs-_4WbA1cc.cjs +0 -1
  165. package/dist/tabs-yQ3oGziM.js +0 -106
  166. package/dist/textarea-1kZEh7ki.cjs +0 -1
  167. package/dist/textarea-b2QvVhrK.js +0 -73
  168. package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
  169. package/dist/useAddBlock-FEKFJNwQ.js +0 -69
  170. package/dist/useChaiExternalData-fkFgoS80.js +0 -6
  171. package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
  172. package/dist/useDarkMode-7i57segK.cjs +0 -1
  173. package/dist/useDarkMode-8VHJlYyE.js +0 -23
  174. package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
  175. package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
  176. package/dist/useStylingState-Iuj84yvc.js +0 -186
  177. package/dist/useStylingState-OIvJMV6p.cjs +0 -1
  178. package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
  179. package/dist/useUiLibraries-psyWFbNc.js +0 -12
  180. package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
  181. package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
  182. package/dist/utils-dze1SGvB.js +0 -6
  183. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -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"),D=require("jotai"),u=require("lodash-es"),s=require("./index-F4AQQ6qq.cjs"),R=require("lucide-react"),_=require("@chaibuilder/runtime"),f=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),S=require("./index-l19JVVXI.cjs"),l=require("./MODIFIERS-9EwxLM8V.cjs"),K=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-toggle");require("class-variance-authority");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("flagged");require("react-hotkeys-hook");const C=({provider:t,onClose:a})=>{const{t:o}=f.useTranslation(),[n,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:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(S.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:n,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 I({children:t,name:a,onRemove:o}){const{t:n}=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:n("remove_provider_confirmation").replace("{name}",a)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:n("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:n("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:o,className:"bg-red-600 hover:bg-red-700",children:n("remove")})]})]})]})}const P=()=>{const{t}=f.useTranslation(),a=i.useMemo(()=>_.getChaiDataProviders(),[]),[o,n]=s.usePageDataProviders(),[,h]=D.useAtom(s.builderSaveStateAtom),[m,c]=i.useState(u.filter(a,r=>u.map(o,"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]),n(j=>[...j,{providerKey:p.providerKey,args:{}}]),E(""),h("UNSAVED")},x=r=>{c(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),n(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",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"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(I,{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",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"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(C,{onClose:()=>d(null),provider:g})]})]})},L=()=>{const{t}=f.useTranslation(),a={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"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(n=>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(n)}),e.jsxRuntimeExports.jsx("div",{children:t(a[n])})]},n))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(n=>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(n)}),e.jsxRuntimeExports.jsx("div",{children:t(o[n])})]},n))})]})})]})]})},O=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-S-4jzdWv.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-SWsqdfcG.cjs"))),A=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-EMCT0Wa3.cjs"))),B=i.lazy(()=>Promise.resolve().then(()=>require("./index-F4AQQ6qq.cjs")).then(t=>t.ImagesPanel));let k=null;const U=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),a=s.useBuilderProp("sideBarComponents.bottom",[]),[o,n]=D.useAtom(s.activePanelAtom),[h,m]=i.useState(o),[c,b]=i.useState(null),{t:E}=f.useTranslation(),g={"add-blocks":O,[l.OUTLINE_KEY]:T,"branding-options":A,images:B};u.each(t,({name:x,panel:v})=>{g[x]=v});const d=x=>{clearTimeout(k),o!==l.OUTLINE_KEY&&x===l.OUTLINE_KEY?k=setTimeout(()=>n(l.OUTLINE_KEY),500):m(x),n(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:[o!==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:o==="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:o===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:o==="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:o===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(L,{}),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,{})})))]})]}),o!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-full w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",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:K.cn("relative z-[100] h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1"),onMouseEnter:()=>{c&&clearTimeout(c)},children:i.createElement(u.get(g,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}):null,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=U;
@@ -1,57 +1,66 @@
1
- import { j as e } from "./jsx-runtime-Sp0orL4X.js";
2
- import { KeyboardIcon as U, PlusIcon as J, Half2Icon as W } from "@radix-ui/react-icons";
3
- import j, { useMemo as Y, useState as h, useEffect as Z, lazy as w, Suspense as N } from "react";
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 h, useEffect as W, useMemo as Y, lazy as w, Suspense as N } from "react";
4
4
  import { useAtom as O } from "jotai";
5
- import { filter as y, map as K, isNull as q, isEmpty as $, find as G, each as Q, get as X } from "lodash-es";
6
- import { T as ee, a as se, B as v, c as re, u as T, S as E } from "./skeleton-lu8e7q2y.js";
7
- import { D as M, b as H, c as F, e as R, f as le, a as ae, T as B, g as z, h as S, i as A } from "./tabs-yQ3oGziM.js";
8
- import { o as ie, q as te, E as oe, s as ne } from "./ChaiBuilderEditor-vP4at00I.js";
5
+ import { filter as y, map as K, isNull as Z, find as $, isEmpty as G, each as Q, get as X } from "lodash-es";
6
+ import { ad as M, ae as H, af as F, ag as R, ah as ee, A as se, a as re, b as ae, c as le, 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 he, al as pe, 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 I, aw as A, ax as S } from "./index-CFUoB97-.js";
7
+ import { ListTreeIcon as _, DatabaseIcon as Ne } from "lucide-react";
8
+ import { getChaiDataProviders as ye } from "@chaibuilder/runtime";
9
9
  import { useTranslation as g } from "react-i18next";
10
- import { ListTreeIcon as _, DatabaseIcon as ce } from "lucide-react";
11
- import { getChaiDataProviders as de } from "@chaibuilder/runtime";
12
- import { A as me, a as xe, b as he, c as ue, e as pe, f as fe, d as je, h as ve, g as ge } from "./alert-dialog-rypfO5ly.js";
13
- import { S as be, c as Ne, b as ye, d as we, f as V } from "./select-POGdEDHT.js";
14
- import { J as ke, a as De, d as Ce } from "./index-lDTsQp7h.js";
15
- import { O as i } from "./STRINGS-b432aBJJ.js";
16
- import { B as I } from "./badge-tEwO7C51.js";
17
- import { c as Te } from "./Functions-NzT2Six_.js";
18
- import "@radix-ui/react-slot";
19
- import "class-variance-authority";
20
- import "./utils-dze1SGvB.js";
10
+ import { J as we, a as ke, d as Ce } from "./index-e0c8PmRQ.js";
11
+ import { E as De } from "./index-lOJfSheQ.js";
12
+ import { O as i } from "./MODIFIERS-WQdaNvb8.js";
13
+ import { c as Te } from "./Functions-7jnEwJyw.js";
14
+ import "./_commonjsHelpers-UyOWmZb0.js";
15
+ import "@react-hookz/web";
16
+ import "./Class-3k8xjeiM.js";
21
17
  import "clsx";
22
18
  import "tailwind-merge";
23
- import "@radix-ui/react-tooltip";
24
- import "@radix-ui/react-toast";
19
+ import "@radix-ui/react-toggle";
20
+ import "class-variance-authority";
21
+ import "@radix-ui/react-switch";
22
+ import "@radix-ui/react-slot";
23
+ import "@radix-ui/react-accordion";
24
+ import "@radix-ui/react-alert-dialog";
25
25
  import "@radix-ui/react-dialog";
26
- import "@radix-ui/react-tabs";
27
- import "./MODIFIERS-CNqNUapY.js";
26
+ import "@radix-ui/react-label";
28
27
  import "@radix-ui/react-scroll-area";
28
+ import "@radix-ui/react-tabs";
29
+ import "@radix-ui/react-tooltip";
30
+ import "@radix-ui/react-popover";
31
+ import "@radix-ui/react-menubar";
32
+ import "@radix-ui/react-hover-card";
33
+ import "@radix-ui/react-select";
34
+ import "@radix-ui/react-dropdown-menu";
35
+ import "@radix-ui/react-separator";
36
+ import "@radix-ui/react-toast";
37
+ import "cmdk";
38
+ import "@radix-ui/react-context-menu";
39
+ import "react-icons-picker";
29
40
  import "react-dom";
30
- import "@floating-ui/react-dom";
41
+ import "react-quill";
31
42
  import "i18next";
43
+ import "@floating-ui/react-dom";
32
44
  import "flagged";
33
45
  import "react-hotkeys-hook";
34
- import "@react-hookz/web";
35
- import "@radix-ui/react-alert-dialog";
36
- import "@radix-ui/react-select";
37
- const Se = ({ provider: s, onClose: o }) => {
38
- const { t: a } = g(), [l, u] = h(null);
39
- return Z(() => {
40
- s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => u(n));
46
+ const Ae = ({ provider: s, onClose: o }) => {
47
+ const { t: l } = g(), [a, p] = h(null);
48
+ return W(() => {
49
+ s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => p(n));
41
50
  }, [s]), s ? /* @__PURE__ */ e.jsx(M, { onOpenChange: (d) => d ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(H, { children: [
42
51
  /* @__PURE__ */ e.jsxs(F, { children: [
43
52
  /* @__PURE__ */ e.jsxs(R, { children: [
44
- a("data_provider"),
53
+ l("data_provider"),
45
54
  ": ",
46
55
  s.name
47
56
  ] }),
48
- /* @__PURE__ */ e.jsx(le, { children: s.description })
57
+ /* @__PURE__ */ e.jsx(ee, { children: s.description })
49
58
  ] }),
50
- /* @__PURE__ */ e.jsx(oe, { children: /* @__PURE__ */ e.jsx(
51
- ke,
59
+ /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(
60
+ we,
52
61
  {
53
- data: l,
54
- shouldExpandNode: De,
62
+ data: a,
63
+ shouldExpandNode: ke,
55
64
  style: {
56
65
  ...Ce,
57
66
  container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
@@ -62,55 +71,55 @@ const Se = ({ provider: s, onClose: o }) => {
62
71
  ) })
63
72
  ] }) }) : null;
64
73
  };
65
- function Ae({
74
+ function Se({
66
75
  children: s,
67
76
  name: o,
68
- onRemove: a
77
+ onRemove: l
69
78
  }) {
70
- const { t: l } = g();
71
- return /* @__PURE__ */ e.jsxs(me, { children: [
72
- /* @__PURE__ */ e.jsx(xe, { asChild: !0, children: s }),
73
- /* @__PURE__ */ e.jsxs(he, { children: [
74
- /* @__PURE__ */ e.jsxs(ue, { children: [
79
+ const { t: a } = g();
80
+ return /* @__PURE__ */ e.jsxs(se, { children: [
81
+ /* @__PURE__ */ e.jsx(re, { asChild: !0, children: s }),
82
+ /* @__PURE__ */ e.jsxs(ae, { children: [
83
+ /* @__PURE__ */ e.jsxs(le, { children: [
75
84
  /* @__PURE__ */ e.jsx(
76
- pe,
85
+ ie,
77
86
  {
78
- dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", o) }
87
+ dangerouslySetInnerHTML: { __html: a("remove_provider_confirmation").replace("{name}", o) }
79
88
  }
80
89
  ),
81
- /* @__PURE__ */ e.jsx(fe, { children: l("remove_provider_warning") })
90
+ /* @__PURE__ */ e.jsx(te, { children: a("remove_provider_warning") })
82
91
  ] }),
83
- /* @__PURE__ */ e.jsxs(je, { children: [
84
- /* @__PURE__ */ e.jsx(ve, { children: l("cancel") }),
85
- /* @__PURE__ */ e.jsx(ge, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
92
+ /* @__PURE__ */ e.jsxs(oe, { children: [
93
+ /* @__PURE__ */ e.jsx(ne, { children: a("cancel") }),
94
+ /* @__PURE__ */ e.jsx(ce, { onClick: l, className: "bg-red-600 hover:bg-red-700", children: a("remove") })
86
95
  ] })
87
96
  ] })
88
97
  ] });
89
98
  }
90
99
  const _e = () => {
91
- const { t: s } = g(), o = Y(() => de(), []), [a, l] = ie(), [, u] = O(te), [d, n] = h(
92
- y(o, (r) => K(a, "providerKey").includes(r.providerKey))
93
- ), [k, p] = h(""), [b, c] = h(null), D = y(
100
+ const { t: s } = g(), o = Y(() => ye(), []), [l, a] = de(), [, p] = O(me), [d, n] = h(
101
+ y(o, (r) => K(l, "providerKey").includes(r.providerKey))
102
+ ), [k, u] = h(""), [b, c] = h(null), C = y(
94
103
  o.map((r) => K(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
95
- (r) => !q(r)
96
- ), C = (r) => {
97
- const x = G(o, { providerKey: r });
98
- n((m) => [...m, x]), l((m) => [...m, { providerKey: x.providerKey, args: {} }]), p(""), u("UNSAVED");
104
+ (r) => !Z(r)
105
+ ), D = (r) => {
106
+ const x = $(o, { providerKey: r });
107
+ n((m) => [...m, x]), a((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""), p("UNSAVED");
99
108
  }, t = (r) => {
100
- n((x) => y(x, (m) => m.providerKey !== r.providerKey)), l((x) => y(x, (m) => m.providerKey !== r.providerKey)), u("UNSAVED");
109
+ n((x) => y(x, (m) => m.providerKey !== r.providerKey)), a((x) => y(x, (m) => m.providerKey !== r.providerKey)), p("UNSAVED");
101
110
  }, f = (r) => c(r);
102
- return $(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
111
+ return G(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
103
112
  s("no_data_providers"),
104
113
  /* @__PURE__ */ e.jsx("br", {}),
105
114
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
106
115
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
107
116
  /* @__PURE__ */ e.jsx("br", {}),
108
117
  /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
109
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(be, { value: k, onValueChange: (r) => C(r), children: [
110
- /* @__PURE__ */ e.jsx(Ne, { className: "w-full", children: /* @__PURE__ */ e.jsx(ye, { placeholder: s("select_provider") }) }),
111
- /* @__PURE__ */ e.jsxs(we, { children: [
112
- /* @__PURE__ */ e.jsx(V, { value: "", children: s("choose") }),
113
- D.map((r) => /* @__PURE__ */ e.jsx(V, { value: r.value, children: r.label }, r.value))
118
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(xe, { value: k, onValueChange: (r) => D(r), children: [
119
+ /* @__PURE__ */ e.jsx(he, { className: "w-full", children: /* @__PURE__ */ e.jsx(pe, { placeholder: s("select_provider") }) }),
120
+ /* @__PURE__ */ e.jsxs(ue, { children: [
121
+ /* @__PURE__ */ e.jsx(E, { value: "", children: s("choose") }),
122
+ C.map((r) => /* @__PURE__ */ e.jsx(E, { value: r.value, children: r.label }, r.value))
114
123
  ] })
115
124
  ] }) }),
116
125
  /* @__PURE__ */ e.jsx("br", {}),
@@ -159,7 +168,7 @@ const _e = () => {
159
168
  ]
160
169
  }
161
170
  ),
162
- /* @__PURE__ */ e.jsx(Ae, { 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: [
171
+ /* @__PURE__ */ e.jsx(Se, { 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: [
163
172
  /* @__PURE__ */ e.jsxs(
164
173
  "svg",
165
174
  {
@@ -187,7 +196,7 @@ const _e = () => {
187
196
  },
188
197
  r.providerKey
189
198
  )) }),
190
- /* @__PURE__ */ e.jsx(Se, { onClose: () => c(null), provider: b })
199
+ /* @__PURE__ */ e.jsx(Ae, { onClose: () => c(null), provider: b })
191
200
  ] })
192
201
  ] });
193
202
  }, Pe = () => {
@@ -195,35 +204,35 @@ const _e = () => {
195
204
  "ctrl + Z": "Undo",
196
205
  "ctrl + Y": "Redo",
197
206
  "ctrl + D": "Duplicate"
198
- }, a = {
207
+ }, l = {
199
208
  // "ctrl + /": "Rename block",
200
209
  "ctrl + S": "Save page",
201
210
  esc: "Deselect blocks",
202
211
  del: "Delete block"
203
212
  };
204
213
  return /* @__PURE__ */ e.jsxs(M, { children: [
205
- /* @__PURE__ */ e.jsx(ae, { children: /* @__PURE__ */ e.jsxs(ee, { children: [
206
- /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(v, { size: "sm", className: "w-10", variant: "outline", children: /* @__PURE__ */ e.jsx(U, {}) }) }),
207
- /* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
214
+ /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(je, { children: [
215
+ /* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsx(v, { size: "sm", className: "w-10", variant: "outline", children: /* @__PURE__ */ e.jsx(U, {}) }) }),
216
+ /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
208
217
  ] }) }),
209
218
  /* @__PURE__ */ e.jsxs(H, { className: "sm:max-w-[525px]", children: [
210
219
  /* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children: s("Keyboard shortcuts") }) }),
211
220
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
212
- /* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
213
- /* @__PURE__ */ e.jsx(I, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
214
- /* @__PURE__ */ e.jsx("div", { children: s(o[l]) })
215
- ] }, l)) }),
216
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(a).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
217
- /* @__PURE__ */ e.jsx(I, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
218
- /* @__PURE__ */ e.jsx("div", { children: s(a[l]) })
219
- ] }, l)) })
221
+ /* @__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: [
222
+ /* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
223
+ /* @__PURE__ */ e.jsx("div", { children: s(o[a]) })
224
+ ] }, a)) }),
225
+ /* @__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: [
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(l[a]) })
228
+ ] }, a)) })
220
229
  ] }) })
221
230
  ] })
222
231
  ] });
223
- }, Ke = w(() => import("./AddBlocks-Ol3iIVKa.js")), P = w(() => import("./ListTree-N3jeD790.js")), Ee = w(() => import("./BrandingOptions-iTyWpwTs.js")), Be = w(() => import("./ImagesPanel-Wb0GF_NA.js"));
232
+ }, Ke = w(() => import("./AddBlocks-ksZjjn0k.js")), P = w(() => import("./ListTree-Muu4rAtp.js")), Ee = w(() => import("./BrandingOptions-T_kbQFQv.js")), Be = w(() => import("./index-CFUoB97-.js").then((s) => s.cq));
224
233
  let L = null;
225
- const js = () => {
226
- const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [a, l] = O(ne), [u, d] = h(a), [n, k] = h(null), { t: p } = g(), b = {
234
+ const Ds = () => {
235
+ const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = O(be), [p, d] = h(l), [n, k] = h(null), { t: u } = g(), b = {
227
236
  "add-blocks": Ke,
228
237
  [i]: P,
229
238
  "branding-options": Ee,
@@ -233,19 +242,19 @@ const js = () => {
233
242
  b[t] = f;
234
243
  });
235
244
  const c = (t) => {
236
- clearTimeout(L), a !== i && t === i ? L = setTimeout(() => l(i), 500) : d(t), l(t);
237
- }, D = T("dataBindingSupport", !1);
238
- function C() {
245
+ clearTimeout(L), l !== i && t === i ? L = setTimeout(() => a(i), 500) : d(t), a(t);
246
+ }, C = T("dataBindingSupport", !1);
247
+ function D() {
239
248
  const t = setTimeout(() => {
240
249
  n && (c(i), clearTimeout(n));
241
250
  }, 500);
242
251
  k(t);
243
252
  }
244
253
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
245
- a !== i ? /* @__PURE__ */ e.jsx(
254
+ l !== i ? /* @__PURE__ */ e.jsx(
246
255
  "div",
247
256
  {
248
- onMouseEnter: C,
257
+ onMouseEnter: D,
249
258
  onClick: () => c(i),
250
259
  className: "fixed inset-0 z-[50] bg-black/20"
251
260
  }
@@ -259,7 +268,7 @@ const js = () => {
259
268
  c("add-blocks");
260
269
  },
261
270
  size: "sm",
262
- variant: a === "add-blocks" ? "default" : "outline",
271
+ variant: l === "add-blocks" ? "default" : "outline",
263
272
  children: /* @__PURE__ */ e.jsx(J, { className: "text-xl" })
264
273
  }
265
274
  ),
@@ -268,7 +277,7 @@ const js = () => {
268
277
  {
269
278
  onClick: () => c(i),
270
279
  size: "sm",
271
- variant: a === i ? "default" : "outline",
280
+ variant: l === i ? "default" : "outline",
272
281
  children: /* @__PURE__ */ e.jsx(_, { className: "w-4" })
273
282
  }
274
283
  ),
@@ -277,18 +286,18 @@ const js = () => {
277
286
  {
278
287
  onClick: () => c("branding-options"),
279
288
  size: "sm",
280
- variant: a === "branding-options" ? "default" : "outline",
281
- children: /* @__PURE__ */ e.jsx(W, { className: "w-4 max-w-[40px] text-xs" })
289
+ variant: l === "branding-options" ? "default" : "outline",
290
+ children: /* @__PURE__ */ e.jsx(q, { className: "w-4 max-w-[40px] text-xs" })
282
291
  }
283
292
  ),
284
293
  j.Children.toArray(
285
- s.map(({ name: t, icon: f }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(E, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
294
+ s.map(({ name: t, icon: f }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
286
295
  v,
287
296
  {
288
297
  onClick: () => c(t),
289
298
  size: "sm",
290
299
  className: "w-10",
291
- variant: a === t ? "default" : "outline",
300
+ variant: l === t ? "default" : "outline",
292
301
  children: /* @__PURE__ */ e.jsx(f, {})
293
302
  }
294
303
  ) }))
@@ -297,11 +306,11 @@ const js = () => {
297
306
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
298
307
  /* @__PURE__ */ e.jsx(Pe, {}),
299
308
  j.Children.toArray(
300
- o.map((t) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(E, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
309
+ o.map((t) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
301
310
  )
302
311
  ] })
303
312
  ] }),
304
- a !== i ? /* @__PURE__ */ e.jsx(
313
+ l !== i ? /* @__PURE__ */ e.jsx(
305
314
  "div",
306
315
  {
307
316
  className: "absolute left-14 z-[50] h-full w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
@@ -320,7 +329,7 @@ const js = () => {
320
329
  onMouseEnter: () => {
321
330
  n && clearTimeout(n);
322
331
  },
323
- children: j.createElement(X(b, a, () => /* @__PURE__ */ e.jsx("div", {})))
332
+ children: j.createElement(X(b, l, () => /* @__PURE__ */ e.jsx("div", {})))
324
333
  }
325
334
  )
326
335
  }
@@ -335,28 +344,28 @@ const js = () => {
335
344
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
336
345
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
337
346
  ] }),
338
- children: D ? /* @__PURE__ */ e.jsxs(B, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
339
- /* @__PURE__ */ e.jsxs(z, { className: "mx-1 grid h-10 grid-cols-2", children: [
340
- /* @__PURE__ */ e.jsxs(S, { value: i, children: [
347
+ children: C ? /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
348
+ /* @__PURE__ */ e.jsxs(I, { className: "mx-1 grid h-10 grid-cols-2", children: [
349
+ /* @__PURE__ */ e.jsxs(A, { value: i, children: [
341
350
  /* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
342
351
  " ",
343
- p("Outline")
352
+ u("Outline")
344
353
  ] }),
345
- /* @__PURE__ */ e.jsxs(S, { value: "data-provider", children: [
346
- /* @__PURE__ */ e.jsx(ce, { className: "mr-2 w-3" }),
347
- p("Data")
354
+ /* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
355
+ /* @__PURE__ */ e.jsx(Ne, { className: "mr-2 w-3" }),
356
+ u("Data")
348
357
  ] })
349
358
  ] }),
350
- /* @__PURE__ */ e.jsx(A, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: j.createElement(P) }),
351
- /* @__PURE__ */ e.jsx(A, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(_e, {}) })
352
- ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(B, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
353
- /* @__PURE__ */ e.jsx(z, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(S, { value: i, children: [
359
+ /* @__PURE__ */ e.jsx(S, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: j.createElement(P) }),
360
+ /* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(_e, {}) })
361
+ ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
362
+ /* @__PURE__ */ e.jsx(I, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(A, { value: i, children: [
354
363
  /* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
355
364
  " ",
356
- p("Outline")
365
+ u("Outline")
357
366
  ] }) }),
358
367
  /* @__PURE__ */ e.jsx(
359
- A,
368
+ S,
360
369
  {
361
370
  value: i,
362
371
  className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
@@ -369,5 +378,5 @@ const js = () => {
369
378
  ] });
370
379
  };
371
380
  export {
372
- js as default
381
+ Ds as default
373
382
  };
@@ -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-F4AQQ6qq.cjs"),v=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("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");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 g=()=>t.useBuilderProp("languages",["en"]),H=()=>g().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 V(l){return v.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 M=()=>{const{savePage:l,saveState:a}=t.useSavePage(),{t:s}=i.useTranslation(),e=t.useBuilderProp("hideSaveButton",!1),n=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]);if(e)return null;const o=c.jsxRuntimeExports.jsxs(t.Button,{disabled:a==="SAVING",onClick:z=>{z.preventDefault(),l()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${n}`,size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(V,{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:o})},u=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},d=()=>{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(H,{}),c.jsxRuntimeExports.jsx(u,{}),c.jsxRuntimeExports.jsx(t.Separator,{orientation:"vertical"}),e?c.jsxRuntimeExports.jsx(M,{}):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=d;
@@ -0,0 +1,131 @@
1
+ import { j as c } from "./jsx-runtime-WbnYoNE9.js";
2
+ import z, { useMemo as o, Suspense as n } from "react";
3
+ import { FontFamilyIcon as M, EyeOpenIcon as u } from "@radix-ui/react-icons";
4
+ import { h as r, aj as d, ak as C, al as L, am as m, ay as p, az as F, an as i, z as w, B as g, q as B, S as v, aA as f } from "./index-CFUoB97-.js";
5
+ import { G as x } 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 "./MODIFIERS-WQdaNvb8.js";
15
+ import "@react-hookz/web";
16
+ import "./Class-3k8xjeiM.js";
17
+ import "@radix-ui/react-toggle";
18
+ import "class-variance-authority";
19
+ import "@radix-ui/react-switch";
20
+ import "@radix-ui/react-slot";
21
+ import "@radix-ui/react-accordion";
22
+ import "@radix-ui/react-alert-dialog";
23
+ import "@radix-ui/react-dialog";
24
+ import "@radix-ui/react-label";
25
+ import "@radix-ui/react-scroll-area";
26
+ import "@radix-ui/react-tabs";
27
+ import "@radix-ui/react-tooltip";
28
+ import "@radix-ui/react-popover";
29
+ import "@radix-ui/react-menubar";
30
+ import "@radix-ui/react-hover-card";
31
+ import "@radix-ui/react-select";
32
+ import "@radix-ui/react-dropdown-menu";
33
+ import "@radix-ui/react-separator";
34
+ import "@radix-ui/react-toast";
35
+ import "cmdk";
36
+ import "@radix-ui/react-context-menu";
37
+ import "react-icons-picker";
38
+ import "react-dom";
39
+ import "react-quill";
40
+ const S = () => r("languages", ["en"]), A = () => S().length === 1 ? null : /* @__PURE__ */ c.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ c.jsxs(d, { children: [
41
+ /* @__PURE__ */ c.jsx(C, { className: "w-[150px] border-0", children: /* @__PURE__ */ c.jsx(
42
+ L,
43
+ {
44
+ placeholder: /* @__PURE__ */ c.jsxs("span", { className: "flex items-center", children: [
45
+ /* @__PURE__ */ c.jsx(M, { className: "h-4 w-4" }),
46
+ " English(US)"
47
+ ] })
48
+ }
49
+ ) }),
50
+ /* @__PURE__ */ c.jsx(m, { children: /* @__PURE__ */ c.jsxs(p, { children: [
51
+ /* @__PURE__ */ c.jsx(F, { children: "Fruits" }),
52
+ /* @__PURE__ */ c.jsx(i, { value: "apple", children: "Apple" }),
53
+ /* @__PURE__ */ c.jsx(i, { value: "banana", children: "Banana" }),
54
+ /* @__PURE__ */ c.jsx(i, { value: "blueberry", children: "Blueberry" }),
55
+ /* @__PURE__ */ c.jsx(i, { value: "grapes", children: "Grapes" }),
56
+ /* @__PURE__ */ c.jsx(i, { value: "pineapple", children: "Pineapple" })
57
+ ] }) })
58
+ ] }) });
59
+ function R(l) {
60
+ return x({ 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);
61
+ }
62
+ const k = () => {
63
+ const { savePage: l, saveState: t } = w(), { t: s } = e(), h = r("hideSaveButton", !1), a = o(() => {
64
+ switch (t) {
65
+ case "SAVING":
66
+ return "animate-pulse bg-gray-300 text-gray-900";
67
+ case "SAVED":
68
+ return "bg-green-500 text-white hover:bg-green-600 hover:text-white";
69
+ default:
70
+ return "bg-gray-200 text-gray-500 hover:bg-gray-100";
71
+ }
72
+ }, [t]);
73
+ if (h)
74
+ return null;
75
+ const H = /* @__PURE__ */ c.jsxs(
76
+ g,
77
+ {
78
+ disabled: t === "SAVING",
79
+ onClick: (V) => {
80
+ V.preventDefault(), l();
81
+ },
82
+ className: `flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${a}`,
83
+ size: "sm",
84
+ variant: "outline",
85
+ children: [
86
+ /* @__PURE__ */ c.jsx(R, { className: "text-lg" }),
87
+ /* @__PURE__ */ c.jsx("span", { className: "text-sm", children: t === "SAVING" ? "Saving..." : s(t === "SAVED" ? "Saved" : "Unsaved") })
88
+ ]
89
+ }
90
+ );
91
+ return /* @__PURE__ */ c.jsx("div", { className: "flex items-center", children: H });
92
+ }, P = function() {
93
+ const t = r("previewComponent"), [, s] = B(), { t: h } = e();
94
+ return t ? /* @__PURE__ */ c.jsxs(
95
+ g,
96
+ {
97
+ onClick: (a) => {
98
+ a.preventDefault(), s(!0);
99
+ },
100
+ className: "flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",
101
+ size: "sm",
102
+ variant: "outline",
103
+ children: [
104
+ /* @__PURE__ */ c.jsx(u, { className: "text-xs" }),
105
+ /* @__PURE__ */ c.jsx("span", { className: "text-sm", children: h("Preview") })
106
+ ]
107
+ }
108
+ ) : null;
109
+ }, d1 = () => {
110
+ const l = r("topBarComponents.left", []), t = r("topBarComponents.center", []), s = r("topBarComponents.right", []), h = r("editable", !0);
111
+ return /* @__PURE__ */ c.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
112
+ /* @__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(
113
+ l.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
114
+ ) }) }),
115
+ /* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2", children: z.Children.toArray(
116
+ t.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
117
+ ) }),
118
+ /* @__PURE__ */ c.jsxs("div", { className: "flex items-center space-x-2", children: [
119
+ /* @__PURE__ */ c.jsx(A, {}),
120
+ /* @__PURE__ */ c.jsx(P, {}),
121
+ /* @__PURE__ */ c.jsx(f, { orientation: "vertical" }),
122
+ h ? /* @__PURE__ */ c.jsx(k, {}) : null,
123
+ z.Children.toArray(
124
+ s.map((a) => /* @__PURE__ */ c.jsx(n, { fallback: /* @__PURE__ */ c.jsx(v, { className: "h-10" }), children: /* @__PURE__ */ c.jsx(a, {}) }))
125
+ )
126
+ ] })
127
+ ] });
128
+ };
129
+ export {
130
+ d1 as default
131
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-F4AQQ6qq.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("./Class-MmCxz2Ay.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");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 g=async(d,E)=>new Promise((a,i)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>i(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[i,f]=o.useState([]),[c,q]=o.useState(0),[u,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let n=c+1;s&&(s.preventDefault(),n=1),m(!0),q(n);const p={query:j,page:n};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(n===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...i,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,a).then(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),R((r=n==null?void 0:n.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(i)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:i.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):i.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"}),"  Loading..."]}),!l.isEmpty(i)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;