@chaibuilder/sdk 1.2.9 → 1.2.10-7.beta.2

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 (124) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-2fowVPcS.cjs +143 -0
  3. package/dist/CodeEditor-b6uePnTe.js +143 -0
  4. package/dist/STRINGS-RCf9qnaS.cjs +9 -0
  5. package/dist/STRINGS-t8UhMYZ6.js +10 -0
  6. package/dist/Topbar-O21Nrw2O.cjs +137 -0
  7. package/dist/Topbar-xFfdTq1m.js +137 -0
  8. package/dist/UnsplashImages-awQiGFMX.cjs +280 -0
  9. package/dist/UnsplashImages-qQmFIWEy.js +280 -0
  10. package/dist/UploadImages-a8Hl0tyg.cjs +170 -0
  11. package/dist/UploadImages-cudxJepv.js +170 -0
  12. package/dist/context-menu-VMB9i0d8.cjs +1074 -0
  13. package/dist/context-menu-mp3Gu2KA.js +1043 -0
  14. package/dist/controls-4t-C_rP2.cjs +233 -0
  15. package/dist/controls-fQIu127i.js +234 -0
  16. package/dist/core.cjs +135 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-OGxLGBQ1.cjs +156 -0
  20. package/dist/iconBase-Ofd16yeE.js +157 -0
  21. package/dist/index-R7v8ZYnu.js +12110 -0
  22. package/dist/index-WHVUpVPa.cjs +12125 -0
  23. package/dist/jsx-runtime-_yxTjXEh.js +931 -0
  24. package/dist/jsx-runtime-vPqyLgmD.cjs +930 -0
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-RAiM74uD.cjs +116 -0
  27. package/dist/plugin-T1qbgBUO.js +55 -0
  28. package/dist/plugin-YcxlCmRm.js +117 -0
  29. package/dist/plugin-cYi6q9KC.cjs +54 -0
  30. package/dist/render.cjs +215 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +190 -98
  33. package/dist/runtime.cjs +28 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +1524 -1
  37. package/dist/tailwind.cjs +80 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +23 -25
  40. package/dist/ui.cjs +410 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +374 -163
  43. package/dist/web-blocks.cjs +1246 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +961 -789
  46. package/package.json +66 -83
  47. package/dist/AddBlocks-tMxKPoen.js +0 -225
  48. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  49. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  50. package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
  51. package/dist/CanvasArea-mlNKmCOh.js +0 -1425
  52. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  53. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  54. package/dist/CurrentPage-lBy25sZn.js +0 -111
  55. package/dist/Functions-7jnEwJyw.js +0 -15
  56. package/dist/Functions-N3yhPYKY.cjs +0 -1
  57. package/dist/Layers-3Xs4A5i8.js +0 -404
  58. package/dist/Layers-eaHy5PK9.cjs +0 -1
  59. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  60. package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
  61. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  62. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  63. package/dist/PagesPanel--BZhafnt.js +0 -69
  64. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  65. package/dist/ProjectPanel-YcLkM-DW.js +0 -90
  66. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  67. package/dist/Settings-7wlLcvoh.cjs +0 -1
  68. package/dist/Settings-TAgX4hov.js +0 -2186
  69. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  70. package/dist/SidePanels-btVQQkVK.js +0 -349
  71. package/dist/Topbar-V8xCetWF.cjs +0 -1
  72. package/dist/Topbar-j4t4AgCq.js +0 -116
  73. package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
  74. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  75. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  76. package/dist/UploadImages-xBg-kbKv.js +0 -138
  77. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  78. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  79. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  80. package/dist/add-page-modal-cm8damU2.js +0 -108
  81. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  82. package/dist/confirm-alert-i4pM3mOt.js +0 -62
  83. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  84. package/dist/controls-XPXGHKht.js +0 -182
  85. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  86. package/dist/delete-page-modal-YrIBvfFA.js +0 -88
  87. package/dist/email-blocks.cjs +0 -1
  88. package/dist/email-blocks.d.ts +0 -3
  89. package/dist/email-blocks.js +0 -274
  90. package/dist/form-OVmsLOrc.js +0 -125
  91. package/dist/form-VbouZlAW.cjs +0 -1
  92. package/dist/functions-Ox_svtKm.cjs +0 -1
  93. package/dist/functions-xIebp8Aw.js +0 -23
  94. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  95. package/dist/html-to-json-57841sEK.js +0 -183
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-N50dZnlC.cjs +0 -206
  98. package/dist/index-e0c8PmRQ.js +0 -205
  99. package/dist/index-gi1LIOCw.cjs +0 -1
  100. package/dist/index-niHREMmR.js +0 -2938
  101. package/dist/index-pZhGT8uT.js +0 -41620
  102. package/dist/jsx-runtime-WbnYoNE9.js +0 -634
  103. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  104. package/dist/lib.cjs +0 -4
  105. package/dist/lib.d.ts +0 -78
  106. package/dist/lib.js +0 -1322
  107. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  108. package/dist/page-viewer-feqJr1QI.js +0 -115
  109. package/dist/project-general-setting-SgagORzW.js +0 -83
  110. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  111. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  112. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  113. package/dist/server.cjs +0 -1
  114. package/dist/server.d.ts +0 -299
  115. package/dist/server.js +0 -216
  116. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  117. package/dist/single-page-detail-dnWMyg6P.js +0 -222
  118. package/dist/studio.cjs +0 -1
  119. package/dist/studio.d.ts +0 -13
  120. package/dist/studio.js +0 -58
  121. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  122. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  123. package/dist/utils-AvyFzbPC.js +0 -1075
  124. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("@radix-ui/react-icons"),i=require("react"),k=require("jotai"),a=require("lodash-es"),s=require("./index-H6vIwGfD.cjs"),E=require("lucide-react"),C=require("@chaibuilder/runtime"),q=require("react-i18next"),b=require("./index-gi1LIOCw.cjs"),P=require("./index-N50dZnlC.cjs"),T=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("flat-to-nested");require("redux-undo");require("lodash");require("@react-hookz/web");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const D=({provider:t,onClose:x})=>{const{t:n}=q.useTranslation(),[l,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(u=>p(u))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:c=>c?"":x(),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(P.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(b.JsonView,{data:l,shouldExpandNode:b.allExpanded,style:{...b.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 A({children:t,name:x,onRemove:n}){const{t:l}=q.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,{children:l("remove_provider_confirmation",{name:x})}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const _=()=>{const{t}=q.useTranslation(),x=i.useMemo(()=>C.getChaiDataProviders(),[]),[n,l]=s.usePageDataProviders(),[,p]=k.useAtom(s.pageSyncStateAtom),[c,u]=i.useState(a.filter(x,r=>a.map(n,"providerKey").includes(r.providerKey))),[g,v]=i.useState(""),[d,f]=i.useState(null),R=a.filter(x.map(r=>a.map(c,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!a.isNull(r)),o=r=>{const j=a.find(x,{providerKey:r});u(m=>[...m,j]),l(m=>[...m,{providerKey:j.providerKey,args:{}}]),v(""),p("UNSAVED")},h=r=>{u(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),l(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),p("UNSAVED")},S=r=>f(r);return a.isEmpty(x)?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:g,onValueChange:r=>o(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")}),R.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 ${c.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:c.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:()=>S(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(A,{onRemove:()=>h(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(D,{onClose:()=>f(null),provider:d})]})]})},B=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-x2LkOHSj.cjs"))),y=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-eaHy5PK9.cjs"))),z=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-EzT9UYd6.cjs"))),K=i.lazy(()=>Promise.resolve().then(()=>require("./index-H6vIwGfD.cjs")).then(t=>t.ImagesPanel));let N=null;const I=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[n,l]=k.useAtom(s.activePanelAtom),[p,c]=i.useState(n),[u,g]=i.useState(null),v={"add-blocks":B,layers:y,"branding-options":z,images:K};a.each(t,({name:o,panel:h})=>{v[o]=h});const d=o=>{clearTimeout(N),n!=="layers"&&o==="layers"?N=setTimeout(()=>l("layers"),500):c(o),l(o)},f=s.useBuilderProp("dataBindingSupport",!1);function R(){const o=setTimeout(()=>{u&&(d("layers"),clearTimeout(u))},500);g(o)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!=="layers"?e.jsxRuntimeExports.jsx("div",{onMouseEnter:R,onClick:()=>d("layers"),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(w.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("layers"),size:"sm",variant:n==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.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(w.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:o,icon:h})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(o),size:"sm",className:"w-10",variant:n===o?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(x.map(o=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(o,{})})))})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${n!=="layers"?"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:T.cn("relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",n==="layers"?"":"z-[100]"),onMouseEnter:()=>{u&&clearTimeout(u)},children:i.createElement(a.get(v,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:f?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",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:"layers",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"mr-2 w-3"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(_,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md bg-gray-200 py-1",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"ml-2 mr-2 h-4"})," Layers"]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)})]})})})]})};exports.default=I;
@@ -1,349 +0,0 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { PlusIcon as V, Half2Icon as I } from "@radix-ui/react-icons";
3
- import h, { useState as x, useEffect as L, useMemo as M, lazy as y, Suspense as j } from "react";
4
- import { useAtom as z } from "jotai";
5
- import { filter as g, map as P, isNull as F, find as H, isEmpty as J, each as R, get as O } from "lodash-es";
6
- import { al as U, am as $, an as q, ao as G, ap as Z, E as Q, F as W, G as X, H as Y, I as ee, J as se, K as re, L as ae, aq as te, s as ie, t as le, ar as oe, as as ne, at as ce, au as de, av as S, i as k, aw as me, B as b, S as _, ax as xe, ay as pe, az as T, aA as E } from "./index-niHREMmR.js";
7
- import { ListTreeIcon as C, DatabaseIcon as ue } from "lucide-react";
8
- import { getChaiDataProviders as he } from "@chaibuilder/runtime";
9
- import { useTranslation as A } from "react-i18next";
10
- import { J as fe, a as ve, d as je } from "./index-e0c8PmRQ.js";
11
- import { E as ge } from "./index-pZhGT8uT.js";
12
- import { c as be } from "./Functions-7jnEwJyw.js";
13
- import "./_commonjsHelpers-UyOWmZb0.js";
14
- import "@radix-ui/react-toggle";
15
- import "class-variance-authority";
16
- import "./utils-AvyFzbPC.js";
17
- import "./MODIFIERS-RiXS5Mn1.js";
18
- import "clsx";
19
- import "tailwind-merge";
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
- import "flat-to-nested";
42
- import "redux-undo";
43
- import "lodash";
44
- import "@react-hookz/web";
45
- import "i18next";
46
- import "@floating-ui/react-dom";
47
- import "react-textarea-autosize";
48
- import "flagged";
49
- import "react-dnd";
50
- import "@minoru/react-dnd-treeview";
51
- import "react-hotkeys-hook";
52
- import "sonner";
53
- import "./html-to-json-57841sEK.js";
54
- import "himalaya";
55
- import "./web-blocks.js";
56
- import "./controls-XPXGHKht.js";
57
- const ye = ({ provider: r, onClose: l }) => {
58
- const { t: a } = A(), [i, p] = x(null);
59
- return L(() => {
60
- r && (r.mockFn ? r.mockFn : r.dataFn)().then((o) => p(o));
61
- }, [r]), r ? /* @__PURE__ */ e.jsx(U, { onOpenChange: (n) => n ? "" : l(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs($, { children: [
62
- /* @__PURE__ */ e.jsxs(q, { children: [
63
- /* @__PURE__ */ e.jsxs(G, { children: [
64
- a("data_provider"),
65
- ": ",
66
- r.name
67
- ] }),
68
- /* @__PURE__ */ e.jsx(Z, { children: r.description })
69
- ] }),
70
- /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx(
71
- fe,
72
- {
73
- data: i,
74
- shouldExpandNode: ve,
75
- style: {
76
- ...je,
77
- container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
78
- stringValue: "text-orange-600",
79
- label: "text-green-900 font-semibold pr-1 tracking-wider"
80
- }
81
- }
82
- ) })
83
- ] }) }) : null;
84
- };
85
- function we({
86
- children: r,
87
- name: l,
88
- onRemove: a
89
- }) {
90
- const { t: i } = A();
91
- return /* @__PURE__ */ e.jsxs(Q, { children: [
92
- /* @__PURE__ */ e.jsx(W, { asChild: !0, children: r }),
93
- /* @__PURE__ */ e.jsxs(X, { children: [
94
- /* @__PURE__ */ e.jsxs(Y, { children: [
95
- /* @__PURE__ */ e.jsx(ee, { children: i("remove_provider_confirmation", { name: l }) }),
96
- /* @__PURE__ */ e.jsx(se, { children: i("remove_provider_warning") })
97
- ] }),
98
- /* @__PURE__ */ e.jsxs(re, { children: [
99
- /* @__PURE__ */ e.jsx(ae, { children: i("cancel") }),
100
- /* @__PURE__ */ e.jsx(te, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: i("remove") })
101
- ] })
102
- ] })
103
- ] });
104
- }
105
- const Ne = () => {
106
- const { t: r } = A(), l = M(() => he(), []), [a, i] = ie(), [, p] = z(le), [n, o] = x(
107
- g(l, (s) => P(a, "providerKey").includes(s.providerKey))
108
- ), [w, f] = x(""), [c, v] = x(null), N = g(
109
- l.map((s) => P(n, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
110
- (s) => !F(s)
111
- ), t = (s) => {
112
- const m = H(l, { providerKey: s });
113
- o((d) => [...d, m]), i((d) => [...d, { providerKey: m.providerKey, args: {} }]), f(""), p("UNSAVED");
114
- }, u = (s) => {
115
- o((m) => g(m, (d) => d.providerKey !== s.providerKey)), i((m) => g(m, (d) => d.providerKey !== s.providerKey)), p("UNSAVED");
116
- }, B = (s) => v(s);
117
- return J(l) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
118
- r("no_data_providers"),
119
- /* @__PURE__ */ e.jsx("br", {}),
120
- /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: r("learn_more") })
121
- ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
122
- /* @__PURE__ */ e.jsx("br", {}),
123
- /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: r("add_data_providers") }) }),
124
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(oe, { value: w, onValueChange: (s) => t(s), children: [
125
- /* @__PURE__ */ e.jsx(ne, { className: "w-full", children: /* @__PURE__ */ e.jsx(ce, { placeholder: r("select_provider") }) }),
126
- /* @__PURE__ */ e.jsxs(de, { children: [
127
- /* @__PURE__ */ e.jsx(S, { value: "", children: r("choose") }),
128
- N.map((s) => /* @__PURE__ */ e.jsx(S, { value: s.value, children: s.label }, s.value))
129
- ] })
130
- ] }) }),
131
- /* @__PURE__ */ e.jsx("br", {}),
132
- /* @__PURE__ */ e.jsxs("div", { className: `border-t ${n.length ? "block" : "hidden"}`, children: [
133
- /* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
134
- r("page_data_providers"),
135
- ":"
136
- ] }),
137
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: n.map((s) => /* @__PURE__ */ e.jsxs(
138
- "div",
139
- {
140
- className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
141
- "data-v0-t": "card",
142
- children: [
143
- /* @__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: [
144
- /* @__PURE__ */ e.jsx("h3", { className: "font-medium leading-4", children: s.name }),
145
- /* @__PURE__ */ e.jsx("p", { className: "pt-1 text-xs text-gray-400", children: s.description })
146
- ] }) }) }),
147
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-2 py-2", children: [
148
- /* @__PURE__ */ e.jsxs(
149
- "button",
150
- {
151
- onClick: () => B(s),
152
- 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",
153
- children: [
154
- /* @__PURE__ */ e.jsxs(
155
- "svg",
156
- {
157
- xmlns: "http://www.w3.org/2000/svg",
158
- width: "24",
159
- height: "24",
160
- viewBox: "0 0 24 24",
161
- fill: "none",
162
- stroke: "currentColor",
163
- "stroke-width": "2",
164
- "stroke-linecap": "round",
165
- "stroke-linejoin": "round",
166
- className: "mr-2 h-4 w-4",
167
- children: [
168
- /* @__PURE__ */ e.jsx("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
169
- /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" })
170
- ]
171
- }
172
- ),
173
- r("view_data")
174
- ]
175
- }
176
- ),
177
- /* @__PURE__ */ e.jsx(we, { onRemove: () => u(s), name: s.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: [
178
- /* @__PURE__ */ e.jsxs(
179
- "svg",
180
- {
181
- xmlns: "http://www.w3.org/2000/svg",
182
- width: "24",
183
- height: "24",
184
- viewBox: "0 0 24 24",
185
- fill: "none",
186
- stroke: "currentColor",
187
- "stroke-width": "2",
188
- "stroke-linecap": "round",
189
- "stroke-linejoin": "round",
190
- className: "mr-2 h-4 w-4",
191
- children: [
192
- /* @__PURE__ */ e.jsx("path", { d: "M3 6h18" }),
193
- /* @__PURE__ */ e.jsx("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
194
- /* @__PURE__ */ e.jsx("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
195
- ]
196
- }
197
- ),
198
- r("remove")
199
- ] }) })
200
- ] })
201
- ]
202
- },
203
- s.providerKey
204
- )) }),
205
- /* @__PURE__ */ e.jsx(ye, { onClose: () => v(null), provider: c })
206
- ] })
207
- ] });
208
- }, ke = y(() => import("./AddBlocks-tMxKPoen.js")), D = y(() => import("./Layers-3Xs4A5i8.js")), Ce = y(() => import("./BrandingOptions-QJJ1y5ez.js")), De = y(() => import("./index-niHREMmR.js").then((r) => r.cw));
209
- let K = null;
210
- const Ss = () => {
211
- const r = k("sideBarComponents.top", []), l = k("sideBarComponents.bottom", []), [a, i] = z(me), [p, n] = x(a), [o, w] = x(null), f = {
212
- "add-blocks": ke,
213
- layers: D,
214
- "branding-options": Ce,
215
- images: De
216
- };
217
- R(r, ({ name: t, panel: u }) => {
218
- f[t] = u;
219
- });
220
- const c = (t) => {
221
- clearTimeout(K), a !== "layers" && t === "layers" ? K = setTimeout(() => i("layers"), 500) : n(t), i(t);
222
- }, v = k("dataBindingSupport", !1);
223
- function N() {
224
- const t = setTimeout(() => {
225
- o && (c("layers"), clearTimeout(o));
226
- }, 500);
227
- w(t);
228
- }
229
- return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
230
- a !== "layers" ? /* @__PURE__ */ e.jsx(
231
- "div",
232
- {
233
- onMouseEnter: N,
234
- onClick: () => c("layers"),
235
- className: "fixed inset-0 z-[50] bg-black/20"
236
- }
237
- ) : null,
238
- /* @__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: [
239
- /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
240
- /* @__PURE__ */ e.jsx(
241
- b,
242
- {
243
- onClick: () => {
244
- c("add-blocks");
245
- },
246
- size: "sm",
247
- variant: a === "add-blocks" ? "default" : "outline",
248
- children: /* @__PURE__ */ e.jsx(V, { className: "text-xl" })
249
- }
250
- ),
251
- /* @__PURE__ */ e.jsx(
252
- b,
253
- {
254
- onClick: () => c("layers"),
255
- size: "sm",
256
- variant: a === "layers" ? "default" : "outline",
257
- children: /* @__PURE__ */ e.jsx(C, { className: "w-4" })
258
- }
259
- ),
260
- /* @__PURE__ */ e.jsx(
261
- b,
262
- {
263
- onClick: () => c("branding-options"),
264
- size: "sm",
265
- variant: a === "branding-options" ? "default" : "outline",
266
- children: /* @__PURE__ */ e.jsx(I, { className: "w-4 max-w-[40px] text-xs" })
267
- }
268
- ),
269
- h.Children.toArray(
270
- r.map(({ name: t, icon: u }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(_, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
271
- b,
272
- {
273
- onClick: () => c(t),
274
- size: "sm",
275
- className: "w-10",
276
- variant: a === t ? "default" : "outline",
277
- children: /* @__PURE__ */ e.jsx(u, {})
278
- }
279
- ) }))
280
- )
281
- ] }),
282
- /* @__PURE__ */ e.jsx("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: h.Children.toArray(
283
- l.map((t) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(_, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
284
- ) })
285
- ] }),
286
- /* @__PURE__ */ e.jsx(
287
- "div",
288
- {
289
- className: `absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${a !== "layers" ? "translate-x-0" : "-translate-x-full"}`,
290
- children: /* @__PURE__ */ e.jsx(
291
- j,
292
- {
293
- fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
294
- /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
295
- /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
296
- /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
297
- ] }),
298
- children: /* @__PURE__ */ e.jsx(
299
- "div",
300
- {
301
- className: be(
302
- "relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",
303
- a === "layers" ? "" : "z-[100]"
304
- ),
305
- onMouseEnter: () => {
306
- o && clearTimeout(o);
307
- },
308
- children: h.createElement(O(f, a, () => /* @__PURE__ */ e.jsx("div", {})))
309
- }
310
- )
311
- }
312
- )
313
- }
314
- ),
315
- /* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
316
- j,
317
- {
318
- fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
319
- /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
320
- /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
321
- /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
322
- ] }),
323
- children: v ? /* @__PURE__ */ e.jsxs(xe, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
324
- /* @__PURE__ */ e.jsxs(pe, { className: "mx-1 grid h-10 grid-cols-2", children: [
325
- /* @__PURE__ */ e.jsxs(T, { value: "layers", children: [
326
- /* @__PURE__ */ e.jsx(C, { className: "mr-2 h-3" }),
327
- " Layers"
328
- ] }),
329
- /* @__PURE__ */ e.jsxs(T, { value: "data-provider", children: [
330
- /* @__PURE__ */ e.jsx(ue, { className: "mr-2 w-3" }),
331
- "Data"
332
- ] })
333
- ] }),
334
- /* @__PURE__ */ e.jsx(E, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(D) }),
335
- /* @__PURE__ */ e.jsx(E, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ne, {}) })
336
- ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
337
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md bg-gray-200 py-1", children: [
338
- /* @__PURE__ */ e.jsx(C, { className: "ml-2 mr-2 h-4" }),
339
- " Layers"
340
- ] }),
341
- /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(D) })
342
- ] })
343
- }
344
- ) })
345
- ] });
346
- };
347
- export {
348
- Ss as default
349
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-H6vIwGfD.cjs"),a=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");const o=()=>r.useBuilderProp("languages",["en"]),c=()=>o().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(l.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),p=()=>{const{savePage:i,syncState:s}=r.useSavePage(),{t:x}=a.useTranslation(),u=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-500 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"}},[s]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(r.Toggle,{onClick:t=>{t.preventDefault(),i()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),s==="SAVING"?"Saving...":s==="SAVED"?x("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:s==="SAVING"?"Saving...":s==="SAVED"?"Saved":"Save changes"})})]})})},m=()=>{const i=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),x=r.useBuilderProp("topBarComponents.right",[]),u=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(c,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=m;
@@ -1,116 +0,0 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import o, { useMemo as m, Suspense as c } from "react";
3
- import { FontFamilyIcon as x } from "@radix-ui/react-icons";
4
- import { i as a, ar as d, as as h, at as u, au as g, aB as j, aC as v, av as r, ah as f, aD as S, aE as b, aF as N, aG as C, S as p, aH as w } from "./index-niHREMmR.js";
5
- import { useTranslation as y } from "react-i18next";
6
- import "./_commonjsHelpers-UyOWmZb0.js";
7
- import "@radix-ui/react-toggle";
8
- import "class-variance-authority";
9
- import "./utils-AvyFzbPC.js";
10
- import "lodash-es";
11
- import "./MODIFIERS-RiXS5Mn1.js";
12
- import "clsx";
13
- import "tailwind-merge";
14
- import "@radix-ui/react-switch";
15
- import "@radix-ui/react-slot";
16
- import "@radix-ui/react-accordion";
17
- import "@radix-ui/react-alert-dialog";
18
- import "@radix-ui/react-dialog";
19
- import "@radix-ui/react-label";
20
- import "@radix-ui/react-scroll-area";
21
- import "@radix-ui/react-tabs";
22
- import "@radix-ui/react-tooltip";
23
- import "@radix-ui/react-popover";
24
- import "@radix-ui/react-menubar";
25
- import "@radix-ui/react-hover-card";
26
- import "@radix-ui/react-select";
27
- import "@radix-ui/react-dropdown-menu";
28
- import "@radix-ui/react-separator";
29
- import "@radix-ui/react-toast";
30
- import "cmdk";
31
- import "@radix-ui/react-context-menu";
32
- import "react-icons-picker";
33
- import "react-dom";
34
- import "react-quill";
35
- import "jotai";
36
- import "flat-to-nested";
37
- import "./Functions-7jnEwJyw.js";
38
- import "redux-undo";
39
- import "@chaibuilder/runtime";
40
- import "lodash";
41
- import "@react-hookz/web";
42
- const A = () => a("languages", ["en"]), B = () => A().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(d, { children: [
43
- /* @__PURE__ */ e.jsx(h, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
44
- u,
45
- {
46
- placeholder: /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
47
- /* @__PURE__ */ e.jsx(x, { className: "h-4 w-4" }),
48
- " English(US)"
49
- ] })
50
- }
51
- ) }),
52
- /* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsxs(j, { children: [
53
- /* @__PURE__ */ e.jsx(v, { children: "Fruits" }),
54
- /* @__PURE__ */ e.jsx(r, { value: "apple", children: "Apple" }),
55
- /* @__PURE__ */ e.jsx(r, { value: "banana", children: "Banana" }),
56
- /* @__PURE__ */ e.jsx(r, { value: "blueberry", children: "Blueberry" }),
57
- /* @__PURE__ */ e.jsx(r, { value: "grapes", children: "Grapes" }),
58
- /* @__PURE__ */ e.jsx(r, { value: "pineapple", children: "Pineapple" })
59
- ] }) })
60
- ] }) }), T = () => {
61
- const { savePage: i, syncState: t } = f(), { t: l } = y(), n = m(() => {
62
- switch (t) {
63
- case "SAVING":
64
- return "animate-pulse bg-gray-500 text-gray-900";
65
- case "SAVED":
66
- return "bg-green-500 text-white hover:bg-green-600 hover:text-white";
67
- default:
68
- return "bg-gray-200 text-gray-500 hover:bg-gray-100";
69
- }
70
- }, [t]);
71
- return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(S, { children: [
72
- /* @__PURE__ */ e.jsx(b, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
73
- N,
74
- {
75
- onClick: (s) => {
76
- s.preventDefault(), i();
77
- },
78
- className: `flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${n}`,
79
- size: "sm",
80
- variant: "outline",
81
- children: [
82
- /* @__PURE__ */ e.jsx("svg", { fill: "currentColor", width: "16", height: "16", viewBox: "0 0 0.32 0.32", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx(
83
- "path",
84
- {
85
- fillRule: "evenodd",
86
- d: "M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"
87
- }
88
- ) }),
89
- t === "SAVING" ? "Saving..." : t === "SAVED" ? l("Saved") : "Save"
90
- ]
91
- }
92
- ) }),
93
- /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx("p", { children: t === "SAVING" ? "Saving..." : t === "SAVED" ? "Saved" : "Save changes" }) })
94
- ] }) });
95
- }, ge = () => {
96
- const i = a("topBarComponents.left", []), t = a("topBarComponents.center", []), l = a("topBarComponents.right", []), n = a("editable", !0);
97
- return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
98
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: o.Children.toArray(
99
- i.map((s) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
100
- ) }) }),
101
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: o.Children.toArray(
102
- t.map((s) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
103
- ) }),
104
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
105
- /* @__PURE__ */ e.jsx(B, {}),
106
- /* @__PURE__ */ e.jsx(w, { orientation: "vertical" }),
107
- n ? /* @__PURE__ */ e.jsx(T, {}) : null,
108
- o.Children.toArray(
109
- l.map((s) => /* @__PURE__ */ e.jsx(c, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
110
- )
111
- ] })
112
- ] });
113
- };
114
- export {
115
- ge as default
116
- };