@chaibuilder/sdk 1.2.39 → 1.2.40

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 (64) hide show
  1. package/dist/{AddBlocks-2_dpKDpp.js → AddBlocks-Q--k4QYI.js} +1 -1
  2. package/dist/{AddBlocks-p4Hrxjdf.cjs → AddBlocks-a20tIXfX.cjs} +1 -1
  3. package/dist/{CanvasArea-sbec3R-f.cjs → CanvasArea-QQn0aXpj.cjs} +1 -1
  4. package/dist/{CanvasArea-iN0LxF74.js → CanvasArea-ahsds4rc.js} +2 -2
  5. package/dist/{ChaiBuilderEditor-qxbkVVLu.cjs → ChaiBuilderEditor-hcoLrtq8.cjs} +10 -10
  6. package/dist/{ChaiBuilderEditor-JnZFji5_.js → ChaiBuilderEditor-wfEkvtJ0.js} +291 -296
  7. package/dist/{CurrentPage-Lr3ztuMx.js → CurrentPage-f_5eIFbX.js} +2 -2
  8. package/dist/{CurrentPage-m7_GkZ8a.cjs → CurrentPage-zo2GKFUx.cjs} +1 -1
  9. package/dist/{ListTree-uJFhqUk9.js → ListTree-3riQsfip.js} +1 -1
  10. package/dist/{ListTree-piETqoz9.cjs → ListTree-FWHoDfbO.cjs} +1 -1
  11. package/dist/{PagesPanel-lShO3SmJ.cjs → PagesPanel-0Wi0ezNZ.cjs} +1 -1
  12. package/dist/{PagesPanel-R8FWg5Xg.js → PagesPanel-3KIZEXOS.js} +3 -3
  13. package/dist/{ProjectPanel-2dX4bM5q.js → ProjectPanel-0W6XTu0Y.js} +3 -3
  14. package/dist/{ProjectPanel-_4546hym.cjs → ProjectPanel-fEYrObPB.cjs} +1 -1
  15. package/dist/{Settings-J785mqWv.js → Settings-ifUbqcam.js} +2 -2
  16. package/dist/{Settings-e2AZkjqY.cjs → Settings-kDwumlBm.cjs} +1 -1
  17. package/dist/{SidePanels-cN9er64h.js → SidePanels-0P4IaIVn.js} +135 -135
  18. package/dist/SidePanels-JIuL8NLu.cjs +1 -0
  19. package/dist/{ThemeConfiguration-m_jkR2zi.js → ThemeConfiguration-7Hef-UKR.js} +1 -1
  20. package/dist/{ThemeConfiguration-nler1cz3.cjs → ThemeConfiguration-CcUA1_9A.cjs} +1 -1
  21. package/dist/{Topbar-gaBycI3a.js → Topbar-0hOp8tE7.js} +1 -1
  22. package/dist/{Topbar-DmIPkF8D.cjs → Topbar-Wte9Jbw7.cjs} +1 -1
  23. package/dist/UILibrariesPanel-qgwFZYvn.js +145 -0
  24. package/dist/UILibrariesPanel-vXOD3qRz.cjs +1 -0
  25. package/dist/{UnsplashImages-mC2ewX9D.cjs → UnsplashImages-Cfq1lKeC.cjs} +1 -1
  26. package/dist/{UnsplashImages-6HmGnetM.js → UnsplashImages-qUDa1vAS.js} +1 -1
  27. package/dist/{UploadImages-qRW8zhKj.js → UploadImages-Xh-lPuZy.js} +1 -1
  28. package/dist/{UploadImages-fo9ufcCE.cjs → UploadImages-Zle03BGi.cjs} +1 -1
  29. package/dist/{add-page-modal-mP9aTfG9.cjs → add-page-modal-0jmyeD0x.cjs} +1 -1
  30. package/dist/{add-page-modal-0OuVNgx3.js → add-page-modal-ued8fkUY.js} +3 -3
  31. package/dist/{confirm-alert-Mv-Iofef.js → confirm-alert-4kucBgrO.js} +1 -1
  32. package/dist/{confirm-alert-3cDnni4v.cjs → confirm-alert-rucvO9GC.cjs} +1 -1
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.d.ts +19 -3
  35. package/dist/core.js +1 -1
  36. package/dist/{delete-page-modal-PTwcrTET.cjs → delete-page-modal-Eym3aZzC.cjs} +1 -1
  37. package/dist/{delete-page-modal-BVz9nreM.js → delete-page-modal-kxeOpfNd.js} +2 -2
  38. package/dist/email.cjs +1 -1
  39. package/dist/email.d.ts +19 -3
  40. package/dist/email.js +1 -1
  41. package/dist/{form-e8l4xtI9.js → form-2Veryr30.js} +1 -1
  42. package/dist/{form-o7e6NNTk.cjs → form-pdF1XhvW.cjs} +1 -1
  43. package/dist/{index-CdnwVCXv.js → index-OdzdznTv.js} +2 -2
  44. package/dist/{index--XTVdy1h.cjs → index-SQ1sNajH.cjs} +1 -1
  45. package/dist/{page-viewer-OopsJHBE.js → page-viewer-6qv40Sm2.js} +3 -3
  46. package/dist/{page-viewer-cjvx3lg7.cjs → page-viewer-qr3NscoT.cjs} +1 -1
  47. package/dist/{project-general-setting-n8KKf8qD.js → project-general-setting-GVzAsfrk.js} +3 -3
  48. package/dist/{project-general-setting-3sdmeYrS.cjs → project-general-setting-fm1YfS_2.cjs} +1 -1
  49. package/dist/{project-seo-setting-E554FQ3V.cjs → project-seo-setting-06jt9oDD.cjs} +1 -1
  50. package/dist/{project-seo-setting-pu3qUSE0.js → project-seo-setting-iPqsGKuc.js} +2 -2
  51. package/dist/{single-page-detail-hcTkta3X.js → single-page-detail-GVtRl8Pt.js} +4 -4
  52. package/dist/{single-page-detail-KdxEu4WS.cjs → single-page-detail-KQVwWJ-J.cjs} +1 -1
  53. package/dist/studio.cjs +1 -1
  54. package/dist/studio.d.ts +19 -3
  55. package/dist/studio.js +2 -2
  56. package/dist/ui.cjs +1 -1
  57. package/dist/ui.d.ts +1 -1
  58. package/dist/ui.js +1 -1
  59. package/dist/{useCanvasSettings-6lwRwexD.js → useCanvasSettings-E5uIyvUR.js} +1 -1
  60. package/dist/{useCanvasSettings-oERGzYXb.cjs → useCanvasSettings-yYU51FJ3.cjs} +1 -1
  61. package/package.json +1 -1
  62. package/dist/SidePanels-Vfw9Ir6p.cjs +0 -1
  63. package/dist/UILibrariesPanel-Igx0R4zc.js +0 -138
  64. package/dist/UILibrariesPanel-N144UO0E.cjs +0 -1
@@ -1,15 +1,15 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { KeyboardIcon as q, PlusIcon as E, Component2Icon as G } from "@radix-ui/react-icons";
3
- import f, { useState as h, useEffect as Q, useMemo as X, memo as ee, lazy as v, Suspense as N } from "react";
4
- import { useAtom as H } from "jotai";
5
- import { filter as j, map as z, isNull as se, find as F, isEmpty as R, values as re, each as ae, get as le } from "lodash-es";
6
- import { Z as J, _ as Z, $ as W, a0 as Y, a1 as ie, a2 as te, A as oe, a as ne, b as ce, c as de, d as me, e as xe, f as he, g as ue, a3 as pe, a4 as fe, a5 as je, a6 as ve, a7 as ge, a8 as be, a9 as Ne, aa as I, ab as ye, ac as we, ad as ke, ae as Ce, af as L, h as y, ag as De, O as Te, B as x, ah as V, ai as O, aj as M, ak as P, al as S } from "./ChaiBuilderEditor-JnZFji5_.js";
7
- import { ListTreeIcon as B, PaletteIcon as _e, DatabaseIcon as Ae } from "lucide-react";
8
- import { getChaiDataProviders as Pe, useChaiBlocks as Se } from "@chaibuilder/runtime";
9
- import { useTranslation as g } from "react-i18next";
10
- import { J as Be, a as Ke, d as Ee } from "./index-e0c8PmRQ.js";
2
+ import { KeyboardIcon as J, PlusIcon as K, Component2Icon as Z } from "@radix-ui/react-icons";
3
+ import f, { useState as h, useEffect as W, useMemo as Y, memo as $, lazy as j, Suspense as N } from "react";
4
+ import { useAtom as O } from "jotai";
5
+ import { filter as y, map as E, isNull as q, find as G, isEmpty as Q, each as X, get as ee } from "lodash-es";
6
+ import { Z as H, _ as U, $ as F, a0 as R, a1 as se, a2 as re, A as ae, a as le, b as ie, c as te, d as oe, e as ne, f as ce, g as de, a3 as me, a4 as xe, a5 as he, a6 as ue, a7 as pe, a8 as fe, a9 as je, aa as z, ab as ve, ac as ge, ad as be, ae as Ne, af as B, h as w, ag as ye, B as x, ah as L, ai as V, aj as I, ak as T, al as _ } from "./ChaiBuilderEditor-wfEkvtJ0.js";
7
+ import { ListTreeIcon as A, PaletteIcon as we, DatabaseIcon as ke } from "lucide-react";
8
+ import { getChaiDataProviders as Ce } from "@chaibuilder/runtime";
9
+ import { useTranslation as v } from "react-i18next";
10
+ import { J as De, a as Te, d as _e } from "./index-e0c8PmRQ.js";
11
11
  import { O as i } from "./STRINGS--j49GZJP.js";
12
- import { c as ze } from "./Functions-7jnEwJyw.js";
12
+ import { c as Ae } from "./Functions-7jnEwJyw.js";
13
13
  import "./_commonjsHelpers-UyOWmZb0.js";
14
14
  import "clsx";
15
15
  import "react-dom";
@@ -43,26 +43,26 @@ import "@radix-ui/react-context-menu";
43
43
  import "react-icons-picker";
44
44
  import "react-quill";
45
45
  import "react-hotkeys-hook";
46
- const Ie = ({ provider: s, onClose: o }) => {
47
- const { t: a } = g(), [l, u] = h(null);
48
- return Q(() => {
49
- s && (s.mockFn ? s.mockFn : s.dataFn)().then((c) => u(c));
50
- }, [s]), s ? /* @__PURE__ */ e.jsx(J, { onOpenChange: (m) => m ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(Z, { children: [
51
- /* @__PURE__ */ e.jsxs(W, { children: [
52
- /* @__PURE__ */ e.jsxs(Y, { children: [
46
+ const Pe = ({ provider: r, onClose: t }) => {
47
+ const { t: a } = v(), [l, u] = h(null);
48
+ return W(() => {
49
+ r && (r.mockFn ? r.mockFn : r.dataFn)().then((c) => u(c));
50
+ }, [r]), r ? /* @__PURE__ */ e.jsx(H, { onOpenChange: (d) => d ? "" : t(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(U, { children: [
51
+ /* @__PURE__ */ e.jsxs(F, { children: [
52
+ /* @__PURE__ */ e.jsxs(R, { children: [
53
53
  a("data_provider"),
54
54
  ": ",
55
- s.name
55
+ r.name
56
56
  ] }),
57
- /* @__PURE__ */ e.jsx(ie, { children: s.description })
57
+ /* @__PURE__ */ e.jsx(se, { children: r.description })
58
58
  ] }),
59
- /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(
60
- Be,
59
+ /* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsx(
60
+ De,
61
61
  {
62
62
  data: l,
63
- shouldExpandNode: Ke,
63
+ shouldExpandNode: Te,
64
64
  style: {
65
- ...Ee,
65
+ ..._e,
66
66
  container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
67
67
  stringValue: "text-orange-600",
68
68
  label: "text-green-900 font-semibold pr-1 tracking-wider"
@@ -71,78 +71,78 @@ const Ie = ({ provider: s, onClose: o }) => {
71
71
  ) })
72
72
  ] }) }) : null;
73
73
  };
74
- function Le({
75
- children: s,
76
- name: o,
74
+ function Se({
75
+ children: r,
76
+ name: t,
77
77
  onRemove: a
78
78
  }) {
79
- const { t: l } = g();
80
- return /* @__PURE__ */ e.jsxs(oe, { children: [
81
- /* @__PURE__ */ e.jsx(ne, { asChild: !0, children: s }),
82
- /* @__PURE__ */ e.jsxs(ce, { children: [
83
- /* @__PURE__ */ e.jsxs(de, { children: [
79
+ const { t: l } = v();
80
+ return /* @__PURE__ */ e.jsxs(ae, { children: [
81
+ /* @__PURE__ */ e.jsx(le, { asChild: !0, children: r }),
82
+ /* @__PURE__ */ e.jsxs(ie, { children: [
83
+ /* @__PURE__ */ e.jsxs(te, { children: [
84
84
  /* @__PURE__ */ e.jsx(
85
- me,
85
+ oe,
86
86
  {
87
- dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", o) }
87
+ dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", t) }
88
88
  }
89
89
  ),
90
- /* @__PURE__ */ e.jsx(xe, { children: l("remove_provider_warning") })
90
+ /* @__PURE__ */ e.jsx(ne, { children: l("remove_provider_warning") })
91
91
  ] }),
92
- /* @__PURE__ */ e.jsxs(he, { children: [
93
- /* @__PURE__ */ e.jsx(ue, { children: l("cancel") }),
94
- /* @__PURE__ */ e.jsx(pe, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
92
+ /* @__PURE__ */ e.jsxs(ce, { children: [
93
+ /* @__PURE__ */ e.jsx(de, { children: l("cancel") }),
94
+ /* @__PURE__ */ e.jsx(me, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
95
95
  ] })
96
96
  ] })
97
97
  ] });
98
98
  }
99
- const Ve = () => {
100
- const { t: s } = g(), o = X(() => Pe(), []), [a, l] = fe(), [, u] = H(je), [m, c] = h(
101
- j(o, (r) => z(a, "providerKey").includes(r.providerKey))
102
- ), [w, p] = h(""), [k, b] = h(null), C = j(
103
- o.map((r) => z(m, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
104
- (r) => !se(r)
105
- ), D = (r) => {
106
- const t = F(o, { providerKey: r });
107
- c((d) => [...d, t]), l((d) => [...d, { providerKey: t.providerKey, args: {} }]), p(""), u("UNSAVED");
108
- }, T = (r) => {
109
- c((t) => j(t, (d) => d.providerKey !== r.providerKey)), l((t) => j(t, (d) => d.providerKey !== r.providerKey)), u("UNSAVED");
110
- }, _ = (r) => b(r);
111
- return R(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
112
- s("no_data_providers"),
99
+ const Ke = () => {
100
+ const { t: r } = v(), t = Y(() => Ce(), []), [a, l] = xe(), [, u] = O(he), [d, c] = h(
101
+ y(t, (s) => E(a, "providerKey").includes(s.providerKey))
102
+ ), [k, p] = h(""), [S, g] = h(null), b = y(
103
+ t.map((s) => E(d, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
104
+ (s) => !q(s)
105
+ ), o = (s) => {
106
+ const n = G(t, { providerKey: s });
107
+ c((m) => [...m, n]), l((m) => [...m, { providerKey: n.providerKey, args: {} }]), p(""), u("UNSAVED");
108
+ }, C = (s) => {
109
+ c((n) => y(n, (m) => m.providerKey !== s.providerKey)), l((n) => y(n, (m) => m.providerKey !== s.providerKey)), u("UNSAVED");
110
+ }, D = (s) => g(s);
111
+ return Q(t) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
112
+ r("no_data_providers"),
113
113
  /* @__PURE__ */ e.jsx("br", {}),
114
- /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
114
+ /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: r("learn_more") })
115
115
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
116
116
  /* @__PURE__ */ e.jsx("br", {}),
117
- /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
118
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ve, { value: w, onValueChange: (r) => D(r), children: [
119
- /* @__PURE__ */ e.jsx(ge, { className: "w-full", children: /* @__PURE__ */ e.jsx(be, { placeholder: s("select_provider") }) }),
120
- /* @__PURE__ */ e.jsxs(Ne, { children: [
121
- /* @__PURE__ */ e.jsx(I, { value: "", children: s("choose") }),
122
- C.map((r) => /* @__PURE__ */ e.jsx(I, { value: r.value, children: r.label }, r.value))
117
+ /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: r("add_data_providers") }) }),
118
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ue, { value: k, onValueChange: (s) => o(s), children: [
119
+ /* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(fe, { placeholder: r("select_provider") }) }),
120
+ /* @__PURE__ */ e.jsxs(je, { children: [
121
+ /* @__PURE__ */ e.jsx(z, { value: "", children: r("choose") }),
122
+ b.map((s) => /* @__PURE__ */ e.jsx(z, { value: s.value, children: s.label }, s.value))
123
123
  ] })
124
124
  ] }) }),
125
125
  /* @__PURE__ */ e.jsx("br", {}),
126
- /* @__PURE__ */ e.jsxs("div", { className: `border-t ${m.length ? "block" : "hidden"}`, children: [
126
+ /* @__PURE__ */ e.jsxs("div", { className: `border-t ${d.length ? "block" : "hidden"}`, children: [
127
127
  /* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
128
- s("page_data_providers"),
128
+ r("page_data_providers"),
129
129
  ":"
130
130
  ] }),
131
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: m.map((r) => /* @__PURE__ */ e.jsxs(
131
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: d.map((s) => /* @__PURE__ */ e.jsxs(
132
132
  "div",
133
133
  {
134
134
  className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
135
135
  "data-v0-t": "card",
136
136
  children: [
137
137
  /* @__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: [
138
- /* @__PURE__ */ e.jsx("h3", { className: "font-medium leading-4", children: r.name }),
139
- /* @__PURE__ */ e.jsx("p", { className: "pt-1 text-xs text-gray-400", children: r.description })
138
+ /* @__PURE__ */ e.jsx("h3", { className: "font-medium leading-4", children: s.name }),
139
+ /* @__PURE__ */ e.jsx("p", { className: "pt-1 text-xs text-gray-400", children: s.description })
140
140
  ] }) }) }),
141
141
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-2 py-2", children: [
142
142
  /* @__PURE__ */ e.jsxs(
143
143
  "button",
144
144
  {
145
- onClick: () => _(r),
145
+ onClick: () => D(s),
146
146
  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",
147
147
  children: [
148
148
  /* @__PURE__ */ e.jsxs(
@@ -164,11 +164,11 @@ const Ve = () => {
164
164
  ]
165
165
  }
166
166
  ),
167
- s("view_data")
167
+ r("view_data")
168
168
  ]
169
169
  }
170
170
  ),
171
- /* @__PURE__ */ e.jsx(Le, { 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: () => C(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: [
172
172
  /* @__PURE__ */ e.jsxs(
173
173
  "svg",
174
174
  {
@@ -189,18 +189,18 @@ const Ve = () => {
189
189
  ]
190
190
  }
191
191
  ),
192
- s("remove")
192
+ r("remove")
193
193
  ] }) })
194
194
  ] })
195
195
  ]
196
196
  },
197
- r.providerKey
197
+ s.providerKey
198
198
  )) }),
199
- /* @__PURE__ */ e.jsx(Ie, { onClose: () => b(null), provider: k })
199
+ /* @__PURE__ */ e.jsx(Pe, { onClose: () => g(null), provider: S })
200
200
  ] })
201
201
  ] });
202
- }, Oe = ee(() => {
203
- const { t: s } = g(), o = {
202
+ }, Ee = $(() => {
203
+ const { t: r } = v(), t = {
204
204
  "ctrl + Z": "Undo",
205
205
  "ctrl + Y": "Redo",
206
206
  "ctrl + D": "Duplicate"
@@ -210,121 +210,121 @@ const Ve = () => {
210
210
  esc: "Deselect blocks",
211
211
  del: "Delete block"
212
212
  };
213
- return /* @__PURE__ */ e.jsxs(J, { children: [
214
- /* @__PURE__ */ e.jsx(ye, { children: /* @__PURE__ */ e.jsxs(we, { children: [
215
- /* @__PURE__ */ e.jsx(ke, { children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(q, {}) }) }),
216
- /* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
213
+ return /* @__PURE__ */ e.jsxs(H, { children: [
214
+ /* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsxs(ge, { children: [
215
+ /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(J, {}) }) }),
216
+ /* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsx("p", { children: r("Keyboard shortcuts") }) })
217
217
  ] }) }),
218
- /* @__PURE__ */ e.jsxs(Z, { className: "sm:max-w-[525px]", children: [
219
- /* @__PURE__ */ e.jsx(W, { children: /* @__PURE__ */ e.jsx(Y, { children: s("Keyboard shortcuts") }) }),
218
+ /* @__PURE__ */ e.jsxs(U, { className: "sm:max-w-[525px]", children: [
219
+ /* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children: r("Keyboard shortcuts") }) }),
220
220
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
221
- /* @__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: [
222
- /* @__PURE__ */ e.jsx(L, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
223
- /* @__PURE__ */ e.jsx("div", { children: s(o[l]) })
221
+ /* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(t).map((l) => /* @__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: r(l) }),
223
+ /* @__PURE__ */ e.jsx("div", { children: r(t[l]) })
224
224
  ] }, l)) }),
225
225
  /* @__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: [
226
- /* @__PURE__ */ e.jsx(L, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
227
- /* @__PURE__ */ e.jsx("div", { children: s(a[l]) })
226
+ /* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: r(l) }),
227
+ /* @__PURE__ */ e.jsx("div", { children: r(a[l]) })
228
228
  ] }, l)) })
229
229
  ] }) })
230
230
  ] })
231
231
  ] });
232
- }), Me = v(() => import("./AddBlocks-2_dpKDpp.js")), K = v(() => import("./ListTree-uJFhqUk9.js")), Ue = v(() => import("./ThemeConfiguration-m_jkR2zi.js")), He = v(() => import("./ChaiBuilderEditor-JnZFji5_.js").then((s) => s.co)), Fe = v(() => import("./UILibrariesPanel-Igx0R4zc.js"));
233
- let U = null;
234
- const zs = () => {
235
- const s = y("sideBarComponents.top", []), o = y("sideBarComponents.bottom", []), [a, l] = H(De), [u, m] = h(a), [c, w] = h(null), { t: p } = g(), k = Se(), b = y("filterChaiBlock", () => !0), C = j(k, b), { data: D, isLoading: T } = Te(), _ = !T && !R(D) || F(re(C), { category: "custom" }) !== void 0, r = {
236
- "add-blocks": Me,
237
- [i]: K,
238
- "theme-configuration": Ue,
239
- images: He,
240
- "ui-libraries": Fe
232
+ }), ze = j(() => import("./AddBlocks-Q--k4QYI.js")), P = j(() => import("./ListTree-3riQsfip.js")), Be = j(() => import("./ThemeConfiguration-7Hef-UKR.js")), Le = j(() => import("./ChaiBuilderEditor-wfEkvtJ0.js").then((r) => r.co)), Ve = j(() => import("./UILibrariesPanel-qgwFZYvn.js"));
233
+ let M = null;
234
+ const As = () => {
235
+ const r = w("sideBarComponents.top", []), t = w("sideBarComponents.bottom", []), [a, l] = O(ye), [u, d] = h(a), [c, k] = h(null), { t: p } = v(), g = w("uiLibraries", []).length > 0, b = {
236
+ "add-blocks": ze,
237
+ [i]: P,
238
+ "theme-configuration": Be,
239
+ images: Le,
240
+ "ui-libraries": Ve
241
241
  };
242
- ae(s, ({ name: n, panel: A }) => {
243
- r[n] = A;
242
+ X(r, ({ name: s, panel: n }) => {
243
+ b[s] = n;
244
244
  });
245
- const t = (n) => {
246
- clearTimeout(U), a !== i && n === i ? U = setTimeout(() => l(i), 500) : m(n), l(n);
247
- }, d = y("dataBindingSupport", !1);
248
- function $() {
249
- const n = setTimeout(() => {
250
- c && (t(i), clearTimeout(c));
245
+ const o = (s) => {
246
+ clearTimeout(M), a !== i && s === i ? M = setTimeout(() => l(i), 500) : d(s), l(s);
247
+ }, C = w("dataBindingSupport", !1);
248
+ function D() {
249
+ const s = setTimeout(() => {
250
+ c && (o(i), clearTimeout(c));
251
251
  }, 500);
252
- w(n);
252
+ k(s);
253
253
  }
254
254
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
255
255
  a !== i ? /* @__PURE__ */ e.jsx(
256
256
  "div",
257
257
  {
258
- onMouseEnter: $,
259
- onClick: () => t(i),
258
+ onMouseEnter: D,
259
+ onClick: () => o(i),
260
260
  className: "fixed inset-0 z-[50] bg-black/20"
261
261
  }
262
262
  ) : null,
263
263
  /* @__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: [
264
264
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
265
- _ ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 rounded-md bg-gray-200 p-1", children: [
265
+ g ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 rounded-md bg-gray-200 p-1", children: [
266
266
  /* @__PURE__ */ e.jsx(
267
267
  x,
268
268
  {
269
- onClick: () => t("add-blocks"),
269
+ onClick: () => o("add-blocks"),
270
270
  size: "sm",
271
271
  variant: a === "add-blocks" ? "default" : "outline",
272
- children: /* @__PURE__ */ e.jsx(E, { className: "text-xl" })
272
+ children: /* @__PURE__ */ e.jsx(K, { className: "text-xl" })
273
273
  }
274
274
  ),
275
275
  /* @__PURE__ */ e.jsx(
276
276
  x,
277
277
  {
278
- onClick: () => t("ui-libraries"),
278
+ onClick: () => o("ui-libraries"),
279
279
  size: "sm",
280
280
  variant: a === "ui-libraries" ? "default" : "outline",
281
- children: /* @__PURE__ */ e.jsx(G, { className: "text-xl" })
281
+ children: /* @__PURE__ */ e.jsx(Z, { className: "text-xl" })
282
282
  }
283
283
  )
284
284
  ] }) : /* @__PURE__ */ e.jsx(
285
285
  x,
286
286
  {
287
- onClick: () => t("add-blocks"),
287
+ onClick: () => o("add-blocks"),
288
288
  size: "sm",
289
289
  variant: a === "add-blocks" ? "default" : "outline",
290
- children: /* @__PURE__ */ e.jsx(E, { className: "text-xl" })
290
+ children: /* @__PURE__ */ e.jsx(K, { className: "text-xl" })
291
291
  }
292
292
  ),
293
293
  /* @__PURE__ */ e.jsx(
294
294
  x,
295
295
  {
296
- onClick: () => t(i),
296
+ onClick: () => o(i),
297
297
  size: "sm",
298
298
  variant: a === i ? "default" : "outline",
299
- children: /* @__PURE__ */ e.jsx(B, { className: "w-4" })
299
+ children: /* @__PURE__ */ e.jsx(A, { className: "w-4" })
300
300
  }
301
301
  ),
302
302
  /* @__PURE__ */ e.jsx(
303
303
  x,
304
304
  {
305
- onClick: () => t("theme-configuration"),
305
+ onClick: () => o("theme-configuration"),
306
306
  size: "sm",
307
307
  variant: a === "theme-configuration" ? "default" : "outline",
308
- children: /* @__PURE__ */ e.jsx(_e, { className: "w-4 max-w-[40px] text-xs" })
308
+ children: /* @__PURE__ */ e.jsx(we, { className: "w-4 max-w-[40px] text-xs" })
309
309
  }
310
310
  ),
311
311
  f.Children.toArray(
312
- s.map(({ name: n, icon: A }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
312
+ r.map(({ name: s, icon: n }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(L, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
313
313
  x,
314
314
  {
315
- onClick: () => t(n),
315
+ onClick: () => o(s),
316
316
  size: "sm",
317
317
  className: "w-10",
318
- variant: a === n ? "default" : "outline",
319
- children: /* @__PURE__ */ e.jsx(A, {})
318
+ variant: a === s ? "default" : "outline",
319
+ children: /* @__PURE__ */ e.jsx(n, {})
320
320
  }
321
321
  ) }))
322
322
  )
323
323
  ] }),
324
324
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
325
- /* @__PURE__ */ e.jsx(Oe, {}),
325
+ /* @__PURE__ */ e.jsx(Ee, {}),
326
326
  f.Children.toArray(
327
- o.map((n) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(n, {}) }))
327
+ t.map((s) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(L, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
328
328
  )
329
329
  ] })
330
330
  ] }),
@@ -343,13 +343,13 @@ const zs = () => {
343
343
  children: /* @__PURE__ */ e.jsx(
344
344
  "div",
345
345
  {
346
- className: ze(
346
+ className: Ae(
347
347
  "relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"
348
348
  ),
349
349
  onMouseEnter: () => {
350
350
  c && clearTimeout(c);
351
351
  },
352
- children: f.createElement(le(r, a, () => /* @__PURE__ */ e.jsx("div", {})))
352
+ children: f.createElement(ee(b, a, () => /* @__PURE__ */ e.jsx("div", {})))
353
353
  }
354
354
  )
355
355
  }
@@ -364,32 +364,32 @@ const zs = () => {
364
364
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
365
365
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
366
366
  ] }),
367
- children: d ? /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
368
- /* @__PURE__ */ e.jsxs(M, { className: "mx-1 grid h-10 grid-cols-2", children: [
369
- /* @__PURE__ */ e.jsxs(P, { value: i, children: [
370
- /* @__PURE__ */ e.jsx(B, { className: "mr-2 h-3" }),
367
+ children: C ? /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
368
+ /* @__PURE__ */ e.jsxs(I, { className: "mx-1 grid h-10 grid-cols-2", children: [
369
+ /* @__PURE__ */ e.jsxs(T, { value: i, children: [
370
+ /* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
371
371
  " ",
372
372
  p("Outline")
373
373
  ] }),
374
- /* @__PURE__ */ e.jsxs(P, { value: "data-provider", children: [
375
- /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 w-3" }),
374
+ /* @__PURE__ */ e.jsxs(T, { value: "data-provider", children: [
375
+ /* @__PURE__ */ e.jsx(ke, { className: "mr-2 w-3" }),
376
376
  p("Data")
377
377
  ] })
378
378
  ] }),
379
- /* @__PURE__ */ e.jsx(S, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(K) }),
380
- /* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ve, {}) })
381
- ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
382
- /* @__PURE__ */ e.jsx(M, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(P, { value: i, children: [
383
- /* @__PURE__ */ e.jsx(B, { className: "mr-2 h-3" }),
379
+ /* @__PURE__ */ e.jsx(_, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(P) }),
380
+ /* @__PURE__ */ e.jsx(_, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ke, {}) })
381
+ ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
382
+ /* @__PURE__ */ e.jsx(I, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(T, { value: i, children: [
383
+ /* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
384
384
  " ",
385
385
  p("Outline")
386
386
  ] }) }),
387
387
  /* @__PURE__ */ e.jsx(
388
- S,
388
+ _,
389
389
  {
390
390
  value: i,
391
391
  className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
392
- children: f.createElement(K)
392
+ children: f.createElement(P)
393
393
  }
394
394
  )
395
395
  ] }) })
@@ -398,5 +398,5 @@ const zs = () => {
398
398
  ] });
399
399
  };
400
400
  export {
401
- zs as default
401
+ As as default
402
402
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("@radix-ui/react-icons"),i=require("react"),C=require("jotai"),a=require("lodash-es"),s=require("./ChaiBuilderEditor-hcoLrtq8.cjs"),E=require("lucide-react"),S=require("@chaibuilder/runtime"),v=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),l=require("./STRINGS-gPz7CUOk.cjs"),_=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");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-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-quill");require("react-hotkeys-hook");const D=({provider:r,onClose:x})=>{const{t:n}=v.useTranslation(),[o,p]=i.useState(null);return i.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(d=>p(d))},[r]),r?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:m=>m?"":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"),": ",r.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(s.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:o,shouldExpandNode:w.allExpanded,style:{...w.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function I({children:r,name:x,onRemove:n}){const{t:o}=v.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:r}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:o("remove_provider_confirmation").replace("{name}",x)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:o("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:o("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:o("remove")})]})]})]})}const K=()=>{const{t:r}=v.useTranslation(),x=i.useMemo(()=>S.getChaiDataProviders(),[]),[n,o]=s.usePageDataProviders(),[,p]=C.useAtom(s.builderSaveStateAtom),[m,d]=i.useState(a.filter(x,t=>a.map(n,"providerKey").includes(t.providerKey))),[b,h]=i.useState(""),[q,f]=i.useState(null),R=a.filter(x.map(t=>a.map(m,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!a.isNull(t)),u=t=>{const c=a.find(x,{providerKey:t});d(j=>[...j,c]),o(j=>[...j,{providerKey:c.providerKey,args:{}}]),h(""),p("UNSAVED")},N=t=>{d(c=>a.filter(c,j=>j.providerKey!==t.providerKey)),o(c=>a.filter(c,j=>j.providerKey!==t.providerKey)),p("UNSAVED")},y=t=>f(t);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:[r("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:r("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:r("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:b,onValueChange:t=>u(t),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:r("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:r("choose")}),R.map(t=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:t.value,children:t.label},t.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:[r("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:m.map(t=>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:t.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>y(t),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"})]}),r("view_data")]}),e.jsxRuntimeExports.jsx(I,{onRemove:()=>N(t),name:t.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"})]}),r("remove")]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(D,{onClose:()=>f(null),provider:q})]})]})},P=i.memo(()=>{const{t:r}=v.useTranslation(),x={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},n={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx("div",{className:"flex w-10 items-center justify-center",children:e.jsxRuntimeExports.jsx(g.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:r("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:r("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(x).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:r(o)}),e.jsxRuntimeExports.jsx("div",{children:r(x[o])})]},o))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(n).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:r(o)}),e.jsxRuntimeExports.jsx("div",{children:r(n[o])})]},o))})]})})]})]})}),L=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-a20tIXfX.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-FWHoDfbO.cjs"))),O=i.lazy(()=>Promise.resolve().then(()=>require("./ThemeConfiguration-CcUA1_9A.cjs"))),A=i.lazy(()=>Promise.resolve().then(()=>require("./ChaiBuilderEditor-hcoLrtq8.cjs")).then(r=>r.ImagesPanel)),B=i.lazy(()=>Promise.resolve().then(()=>require("./UILibrariesPanel-vXOD3qRz.cjs")));let k=null;const U=()=>{const r=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[n,o]=C.useAtom(s.activePanelAtom),[p,m]=i.useState(n),[d,b]=i.useState(null),{t:h}=v.useTranslation(),f=s.useBuilderProp("uiLibraries",[]).length>0,R={"add-blocks":L,[l.OUTLINE_KEY]:T,"theme-configuration":O,images:A,"ui-libraries":B};a.each(r,({name:t,panel:c})=>{R[t]=c});const u=t=>{clearTimeout(k),n!==l.OUTLINE_KEY&&t===l.OUTLINE_KEY?k=setTimeout(()=>o(l.OUTLINE_KEY),500):m(t),o(t)},N=s.useBuilderProp("dataBindingSupport",!1);function y(){const t=setTimeout(()=>{d&&(u(l.OUTLINE_KEY),clearTimeout(d))},500);b(t)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:y,onClick:()=>u(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:[f?e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 rounded-md bg-gray-200 p-1",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("add-blocks"),size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("ui-libraries"),size:"sm",variant:n==="ui-libraries"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.Component2Icon,{className:"text-xl"})})]}):e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("add-blocks"),size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u(l.OUTLINE_KEY),size:"sm",variant:n===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("theme-configuration"),size:"sm",variant:n==="theme-configuration"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.PaletteIcon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(r.map(({name:t,icon:c})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u(t),size:"sm",className:"w-10",variant:n===t?"default":"outline",children:e.jsxRuntimeExports.jsx(c,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(P,{}),i.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]}),n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-[100vh] 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:_.cn("relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"),onMouseEnter:()=>{d&&clearTimeout(d)},children:i.createElement(a.get(R,n,()=>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(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"mr-2 w-3"}),h("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(K,{})})]}):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(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("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;
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as c from "react";
3
3
  import j from "@rjsf/validator-ajv8";
4
4
  import k from "@rjsf/core";
5
- import { h as M, F as T, bv as w } from "./ChaiBuilderEditor-JnZFji5_.js";
5
+ import { h as M, F as T, bv as w } from "./ChaiBuilderEditor-wfEkvtJ0.js";
6
6
  import { y as f, c as D, f as a } from "./controls-VTdJhdSz.js";
7
7
  import { debounce as P, noop as R, isEqual as F } from "lodash-es";
8
8
  import { useTranslation as L } from "react-i18next";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),R=require("react"),N=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./ChaiBuilderEditor-qxbkVVLu.cjs"),r=require("./controls-jWJDao88.cjs"),f=require("lodash-es"),k=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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-quill");require("react-hotkeys-hook");require("lucide-react");function M(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const m=M(R),P=({value:t,onChange:e,id:i,onBlur:l})=>{const n=f.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},x=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"},{title:"Bebas Neue",value:"Bebas Neue"},{title:"Manrope",value:"Manrope"}],T=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",f.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=m.useRef(e),{t:v}=k.useTranslation();m.useEffect(()=>()=>{f.isEqual(e,n.current)||t(n.current)},[]);const u=({formData:o},d)=>{d&&(i(o),n.current=o)},{bodyFont:q,headingFont:b,primaryColor:h,bodyTextDarkColor:y,bodyTextLightColor:C,bodyBgDarkColor:S,secondaryColor:j,bodyBgLightColor:O,roundedCorners:B}=e;let s={headingFont:r.y({title:"Heading font",default:b,options:x}),bodyFont:r.y({title:"Body font",default:q,options:x}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(B||5,10)}),primaryColor:r.f({title:"Primary",default:h}),secondaryColor:r.f({title:"Secondary",default:j})};l||(s={...s,bodyBgLightColor:r.f({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.f({title:"Body Text (Light Mode)",default:y}),bodyBgDarkColor:r.f({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.f({title:"Body Text (Dark mode)",default:C})});const c={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const d=s[o];return c.properties||(c.properties={}),c.properties[o]=d.schema,g[o]=d.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:v("Theme Configuration")})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:P},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:c,formData:e,validator:N,onChange:u})})]})};exports.default=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),R=require("react"),N=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./ChaiBuilderEditor-hcoLrtq8.cjs"),r=require("./controls-jWJDao88.cjs"),f=require("lodash-es"),k=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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-quill");require("react-hotkeys-hook");require("lucide-react");function M(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const m=M(R),P=({value:t,onChange:e,id:i,onBlur:l})=>{const n=f.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},x=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"},{title:"Bebas Neue",value:"Bebas Neue"},{title:"Manrope",value:"Manrope"}],T=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",f.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=m.useRef(e),{t:v}=k.useTranslation();m.useEffect(()=>()=>{f.isEqual(e,n.current)||t(n.current)},[]);const u=({formData:o},d)=>{d&&(i(o),n.current=o)},{bodyFont:q,headingFont:b,primaryColor:h,bodyTextDarkColor:y,bodyTextLightColor:C,bodyBgDarkColor:S,secondaryColor:j,bodyBgLightColor:O,roundedCorners:B}=e;let s={headingFont:r.y({title:"Heading font",default:b,options:x}),bodyFont:r.y({title:"Body font",default:q,options:x}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(B||5,10)}),primaryColor:r.f({title:"Primary",default:h}),secondaryColor:r.f({title:"Secondary",default:j})};l||(s={...s,bodyBgLightColor:r.f({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.f({title:"Body Text (Light Mode)",default:y}),bodyBgDarkColor:r.f({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.f({title:"Body Text (Dark mode)",default:C})});const c={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const d=s[o];return c.properties||(c.properties={}),c.properties[o]=d.schema,g[o]=d.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:v("Theme Configuration")})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:P},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:c,formData:e,validator:N,onChange:u})})]})};exports.default=T;
@@ -1,7 +1,7 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import o, { useMemo as h, Suspense as c } from "react";
3
3
  import { FontFamilyIcon as j, EyeOpenIcon as g } from "@radix-ui/react-icons";
4
- import { h as r, a6 as f, a7 as v, a8 as b, a9 as N, am as S, an as w, aa as l, V as y, B as p, ao as C, E as B, ah as m, ap as A } from "./ChaiBuilderEditor-JnZFji5_.js";
4
+ import { h as r, a6 as f, a7 as v, a8 as b, a9 as N, am as S, an as w, aa as l, V as y, B as p, ao as C, E as B, ah as m, ap as A } from "./ChaiBuilderEditor-wfEkvtJ0.js";
5
5
  import { useTranslation as x } from "react-i18next";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "clsx";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),a=require("@radix-ui/react-icons"),r=require("./ChaiBuilderEditor-qxbkVVLu.cjs"),l=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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-quill");require("react-hotkeys-hook");require("lucide-react");const p=()=>r.useBuilderProp("languages",["en"]),m=()=>p().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(a.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"})]})})]})}),j=()=>{const{savePage:u,saveState:s}=r.useSavePage(),{t:i}=l.useTranslation(),x=r.useBuilderProp("hideSaveButton",!1),t=n.useMemo(()=>{switch(s){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"}},[s]);if(x)return null;const o=e.jsxRuntimeExports.jsxs(r.Button,{disabled:s==="SAVING",onClick:c=>{c.preventDefault(),u()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${t}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(r.FaCircleCheck,{className:"text-lg"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:s==="SAVING"?"Saving...":i(s==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},d=function(){const s=r.useBuilderProp("previewComponent"),[,i]=r.usePreviewMode(),{t:x}=l.useTranslation();return s?e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i(!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:[e.jsxRuntimeExports.jsx(a.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:x("Preview")})]}):null},h=()=>{const u=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),i=r.useBuilderProp("topBarComponents.right",[]),x=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(u.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(m,{}),e.jsxRuntimeExports.jsx(d,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),x?e.jsxRuntimeExports.jsx(j,{}):null,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,{})})))]})]})};exports.default=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),a=require("@radix-ui/react-icons"),r=require("./ChaiBuilderEditor-hcoLrtq8.cjs"),l=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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-quill");require("react-hotkeys-hook");require("lucide-react");const p=()=>r.useBuilderProp("languages",["en"]),m=()=>p().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(a.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"})]})})]})}),j=()=>{const{savePage:u,saveState:s}=r.useSavePage(),{t:i}=l.useTranslation(),x=r.useBuilderProp("hideSaveButton",!1),t=n.useMemo(()=>{switch(s){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"}},[s]);if(x)return null;const o=e.jsxRuntimeExports.jsxs(r.Button,{disabled:s==="SAVING",onClick:c=>{c.preventDefault(),u()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${t}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(r.FaCircleCheck,{className:"text-lg"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:s==="SAVING"?"Saving...":i(s==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},d=function(){const s=r.useBuilderProp("previewComponent"),[,i]=r.usePreviewMode(),{t:x}=l.useTranslation();return s?e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i(!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:[e.jsxRuntimeExports.jsx(a.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:x("Preview")})]}):null},h=()=>{const u=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),i=r.useBuilderProp("topBarComponents.right",[]),x=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(u.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(m,{}),e.jsxRuntimeExports.jsx(d,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),x?e.jsxRuntimeExports.jsx(j,{}):null,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,{})})))]})]})};exports.default=h;