@chaibuilder/sdk 1.2.56 → 1.2.57

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 (94) hide show
  1. package/dist/{AddBlocks-HeYXoex4.js → AddBlocks-05ZH2Suu.js} +46 -50
  2. package/dist/AddBlocks-MH_fqSRf.cjs +1 -0
  3. package/dist/{CanvasArea-CqILE5PR.js → CanvasArea-8f_Ki3B7.js} +361 -361
  4. package/dist/CanvasArea-UisRL54b.cjs +56 -0
  5. package/dist/CodeEditor-vECReGwz.cjs +1 -0
  6. package/dist/{CodeEditor-kxV5RCpd.js → CodeEditor-zYBqhBv3.js} +33 -39
  7. package/dist/CurrentPage-7aEIhzQ0.cjs +1 -0
  8. package/dist/{CurrentPage-IrFGAb7n.js → CurrentPage-nzo4lszx.js} +26 -25
  9. package/dist/ListTree-A-097CZ-.cjs +1 -0
  10. package/dist/{ListTree-0n_G8NJx.js → ListTree-KUGhFsb_.js} +9 -13
  11. package/dist/PagesPanel-L1mI3y_6.cjs +1 -0
  12. package/dist/{PagesPanel-RYBf0Yct.js → PagesPanel-hleqqZBo.js} +20 -19
  13. package/dist/ProjectPanel-HTxa1kHv.cjs +1 -0
  14. package/dist/{ProjectPanel-Zagx6l3Q.js → ProjectPanel-RXEhYr0a.js} +25 -24
  15. package/dist/Settings-7EMwx6zL.cjs +1 -0
  16. package/dist/{Settings-RLDTFFf8.js → Settings-b1ZuIn4y.js} +404 -395
  17. package/dist/{SidePanels-ao969pMV.js → SidePanels-6hZeCR5Z.js} +89 -88
  18. package/dist/SidePanels-_6WlMWq_.cjs +1 -0
  19. package/dist/ThemeConfiguration-PvMN3j6h.cjs +1 -0
  20. package/dist/{ThemeConfiguration-S7yArRMp.js → ThemeConfiguration-ab7lbA2y.js} +18 -24
  21. package/dist/Topbar-WdGZIIZp.cjs +1 -0
  22. package/dist/{Topbar-B8u0whpc.js → Topbar-YfsC1DZ2.js} +39 -38
  23. package/dist/{UILibrariesPanel-tcfz2ELp.js → UILibrariesPanel-5QxxXYg2.js} +56 -61
  24. package/dist/UILibrariesPanel-r8nQzXQ-.cjs +1 -0
  25. package/dist/{UnsplashImages-wWRifkCp.js → UnsplashImages-alt_doTy.js} +42 -47
  26. package/dist/UnsplashImages-cah1BRL_.cjs +1 -0
  27. package/dist/UploadImages-5dRETWCo.cjs +1 -0
  28. package/dist/{UploadImages-lUvZhW_j.js → UploadImages-JqVL_aQd.js} +32 -38
  29. package/dist/{add-page-modal-04b4l2zu.js → add-page-modal-CtMwNEsW.js} +29 -28
  30. package/dist/add-page-modal-DA5P4pVu.cjs +1 -0
  31. package/dist/{confirm-alert-FX5030eR.js → confirm-alert-m85JJlQi.js} +15 -21
  32. package/dist/confirm-alert-rYsxlfR4.cjs +1 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +44 -43
  35. package/dist/delete-page-modal-AvUZI9Tk.cjs +1 -0
  36. package/dist/{delete-page-modal-1u9CyAIP.js → delete-page-modal-TMpN1Dvm.js} +22 -21
  37. package/dist/email.cjs +1 -1
  38. package/dist/email.js +19 -19
  39. package/dist/form-G3PqS2Gc.cjs +1 -0
  40. package/dist/{form-HRdEJjVq.js → form-MSL4CDff.js} +3 -3
  41. package/dist/{html-to-json-OnIZDDXw.js → html-to-json-_01DXd-a.js} +37 -36
  42. package/dist/html-to-json-ndxaXRT8.cjs +1 -0
  43. package/dist/{index-vfmO3y2d.js → index--hN9ZQsP.js} +19 -19
  44. package/dist/index-0FIxW0gR.cjs +1 -0
  45. package/dist/{ChaiBuilderEditor-tkzS851D.js → index-IgLSTkN6.js} +14660 -17763
  46. package/dist/index-sspgZwTk.cjs +206 -0
  47. package/dist/index-uLn8W3eR.js +3145 -0
  48. package/dist/index-zaKhyTQ6.cjs +1 -0
  49. package/dist/lib.cjs +2 -2
  50. package/dist/lib.js +17 -16
  51. package/dist/page-viewer-2BMSxxfd.cjs +1 -0
  52. package/dist/{page-viewer-dcb3u4OV.js → page-viewer-D8nsi13f.js} +27 -26
  53. package/dist/project-general-setting--0hX9Otn.cjs +1 -0
  54. package/dist/{project-general-setting--sS34seu.js → project-general-setting-HGjTNFRx.js} +23 -22
  55. package/dist/{project-seo-setting-8tc3I-0M.js → project-seo-setting-3kFJ77jY.js} +20 -26
  56. package/dist/project-seo-setting-C3ilIIeM.cjs +1 -0
  57. package/dist/render.cjs +1 -1
  58. package/dist/render.js +104 -102
  59. package/dist/single-page-detail-7BpYAyMO.cjs +1 -0
  60. package/dist/{single-page-detail-tP2pfgBp.js → single-page-detail-eMnjt_Ih.js} +26 -25
  61. package/dist/studio.cjs +1 -1
  62. package/dist/studio.js +19 -18
  63. package/dist/ui.cjs +1 -1
  64. package/dist/ui.js +144 -150
  65. package/dist/web-blocks.cjs +1 -1
  66. package/dist/web-blocks.js +164 -107
  67. package/package.json +1 -1
  68. package/dist/AddBlocks-VHoZezjj.cjs +0 -1
  69. package/dist/CanvasArea-137WY3Wx.cjs +0 -56
  70. package/dist/ChaiBuilderEditor-aY8flOgX.cjs +0 -206
  71. package/dist/CodeEditor-R2jKe97T.cjs +0 -1
  72. package/dist/CurrentPage-PjrVzHXR.cjs +0 -1
  73. package/dist/ListTree-C6oCXZDV.cjs +0 -1
  74. package/dist/PagesPanel-lIC3kYmS.cjs +0 -1
  75. package/dist/ProjectPanel-0Siyi5YS.cjs +0 -1
  76. package/dist/Settings-6QRVcl16.cjs +0 -1
  77. package/dist/SidePanels-j1EFsBlK.cjs +0 -1
  78. package/dist/ThemeConfiguration-q1471P7b.cjs +0 -1
  79. package/dist/Topbar-ogFKKDbx.cjs +0 -1
  80. package/dist/UILibrariesPanel-cm9CFWxc.cjs +0 -1
  81. package/dist/UnsplashImages-E2L3YDJI.cjs +0 -1
  82. package/dist/UploadImages-s-eeaGiS.cjs +0 -1
  83. package/dist/add-page-modal-eroF20lO.cjs +0 -1
  84. package/dist/confirm-alert-XuxEzG-V.cjs +0 -1
  85. package/dist/delete-page-modal-pgh7sdfg.cjs +0 -1
  86. package/dist/form-Z4IRWj0o.cjs +0 -1
  87. package/dist/html-to-json-rauxDBi6.cjs +0 -1
  88. package/dist/index-bt7EhwLh.cjs +0 -1
  89. package/dist/page-viewer-O960kM2x.cjs +0 -1
  90. package/dist/project-general-setting-lIvNs-Vq.cjs +0 -1
  91. package/dist/project-seo-setting-MIlAuqcc.cjs +0 -1
  92. package/dist/single-page-detail-0Z_hvd_j.cjs +0 -1
  93. package/dist/useCanvasSettings-R0h03UfD.cjs +0 -1
  94. package/dist/useCanvasSettings-rEZHbw3s.js +0 -6
@@ -1,34 +1,29 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { KeyboardIcon as R, PlusIcon as S, Component2Icon as J } from "@radix-ui/react-icons";
3
- import f, { useState as h, useEffect as Z, useMemo as W, memo as Y, lazy as j, Suspense as y } from "react";
2
+ import { KeyboardIcon as U, PlusIcon as _, Component2Icon as J } from "@radix-ui/react-icons";
3
+ import f, { useState as u, useEffect as W, useMemo as Y, memo as Z, lazy as v, Suspense as y } from "react";
4
4
  import { useAtom as M } from "jotai";
5
- import { filter as N, map as K, isNull as $, find as q, isEmpty as G, values as Q, each as X, get as ee } from "lodash-es";
6
- import { Z as O, _ as H, $ as U, a0 as F, a1 as se, a2 as re, A as ae, a as ie, b as te, c as le, 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 B, ab as ve, ac as ge, ad as be, ae as ye, af as E, h as w, ag as Ne, B as x, ah as z, ai as we, aj as ke, ak as L, al as I } from "./ChaiBuilderEditor-tkzS851D.js";
7
- import { ListTreeIcon as A, PaletteIcon as Ce, DatabaseIcon as De } from "lucide-react";
8
- import { getChaiDataProviders as Te, useChaiBlocks as _e } from "@chaibuilder/runtime";
9
- import { useTranslation as v } from "react-i18next";
5
+ import { filter as N, map as K, isNull as G, find as $, isEmpty as q, values as Q, each as X, get as ee } from "lodash-es";
6
+ import { au as O, av as H, aw as F, ax as R, ay as se, A as re, a as ie, b as ae, c as te, d as le, e as oe, f as ne, g as ce, P as de, y as me, R as xe, az as ue, aA as he, aB as pe, aC as fe, aD as B, aE as ve, aF as je, aG as ge, aH as be, aI as E, h as w, aJ as ye, B as x, S as z, aK as Ne, aL as we, aM as L, aN as I } from "./index-uLn8W3eR.js";
7
+ import { ListTreeIcon as P, PaletteIcon as ke, DatabaseIcon as Ce } from "lucide-react";
8
+ import { getChaiDataProviders as De, useChaiBlocks as Te } from "@chaibuilder/runtime";
9
+ import { useTranslation as j } from "react-i18next";
10
10
  import { J as Ae, a as Pe, d as Se } from "./index-e0c8PmRQ.js";
11
+ import { E as _e } from "./index-IgLSTkN6.js";
11
12
  import { O as o } from "./MODIFIERS-fd5XOmum.js";
12
13
  import { c as Ke } from "./Functions-7jnEwJyw.js";
13
14
  import "./_commonjsHelpers-UyOWmZb0.js";
14
- import "clsx";
15
- import "react-dom";
16
- import "@radix-ui/react-scroll-area";
17
- import "@floating-ui/react-dom";
18
- import "i18next";
19
- import "flagged";
20
- import "@react-hookz/web";
21
- import "tree-model";
22
- import "./utils-VpVqnC9m.js";
23
- import "tailwind-merge";
24
15
  import "@radix-ui/react-toggle";
25
16
  import "class-variance-authority";
17
+ import "./utils-VpVqnC9m.js";
18
+ import "clsx";
19
+ import "tailwind-merge";
26
20
  import "@radix-ui/react-switch";
27
21
  import "@radix-ui/react-slot";
28
22
  import "@radix-ui/react-accordion";
29
23
  import "@radix-ui/react-alert-dialog";
30
24
  import "@radix-ui/react-dialog";
31
25
  import "@radix-ui/react-label";
26
+ import "@radix-ui/react-scroll-area";
32
27
  import "@radix-ui/react-tabs";
33
28
  import "@radix-ui/react-tooltip";
34
29
  import "@radix-ui/react-popover";
@@ -41,23 +36,29 @@ import "@radix-ui/react-toast";
41
36
  import "cmdk";
42
37
  import "@radix-ui/react-context-menu";
43
38
  import "react-icons-picker";
39
+ import "react-dom";
44
40
  import "react-quill";
41
+ import "@react-hookz/web";
42
+ import "tree-model";
43
+ import "i18next";
44
+ import "@floating-ui/react-dom";
45
+ import "flagged";
45
46
  import "react-hotkeys-hook";
46
47
  import "./index-VBXQixVm.js";
47
48
  const Be = ({ provider: s, onClose: l }) => {
48
- const { t: i } = v(), [t, u] = h(null);
49
- return Z(() => {
50
- s && (s.mockFn ? s.mockFn : s.dataFn)().then((c) => u(c));
49
+ const { t: a } = j(), [t, h] = u(null);
50
+ return W(() => {
51
+ s && (s.mockFn ? s.mockFn : s.dataFn)().then((c) => h(c));
51
52
  }, [s]), s ? /* @__PURE__ */ e.jsx(O, { onOpenChange: (d) => d ? "" : l(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(H, { children: [
52
- /* @__PURE__ */ e.jsxs(U, { children: [
53
- /* @__PURE__ */ e.jsxs(F, { children: [
54
- i("data_provider"),
53
+ /* @__PURE__ */ e.jsxs(F, { children: [
54
+ /* @__PURE__ */ e.jsxs(R, { children: [
55
+ a("data_provider"),
55
56
  ": ",
56
57
  s.name
57
58
  ] }),
58
59
  /* @__PURE__ */ e.jsx(se, { children: s.description })
59
60
  ] }),
60
- /* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsx(
61
+ /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsx(
61
62
  Ae,
62
63
  {
63
64
  data: t,
@@ -75,41 +76,41 @@ const Be = ({ provider: s, onClose: l }) => {
75
76
  function Ee({
76
77
  children: s,
77
78
  name: l,
78
- onRemove: i
79
+ onRemove: a
79
80
  }) {
80
- const { t } = v();
81
- return /* @__PURE__ */ e.jsxs(ae, { children: [
81
+ const { t } = j();
82
+ return /* @__PURE__ */ e.jsxs(re, { children: [
82
83
  /* @__PURE__ */ e.jsx(ie, { asChild: !0, children: s }),
83
- /* @__PURE__ */ e.jsxs(te, { children: [
84
- /* @__PURE__ */ e.jsxs(le, { children: [
84
+ /* @__PURE__ */ e.jsxs(ae, { children: [
85
+ /* @__PURE__ */ e.jsxs(te, { children: [
85
86
  /* @__PURE__ */ e.jsx(
86
- oe,
87
+ le,
87
88
  {
88
89
  dangerouslySetInnerHTML: { __html: t("remove_provider_confirmation").replace("{name}", l) }
89
90
  }
90
91
  ),
91
- /* @__PURE__ */ e.jsx(ne, { children: t("remove_provider_warning") })
92
+ /* @__PURE__ */ e.jsx(oe, { children: t("remove_provider_warning") })
92
93
  ] }),
93
- /* @__PURE__ */ e.jsxs(ce, { children: [
94
- /* @__PURE__ */ e.jsx(de, { children: t("cancel") }),
95
- /* @__PURE__ */ e.jsx(me, { onClick: i, className: "bg-red-600 hover:bg-red-700", children: t("remove") })
94
+ /* @__PURE__ */ e.jsxs(ne, { children: [
95
+ /* @__PURE__ */ e.jsx(ce, { children: t("cancel") }),
96
+ /* @__PURE__ */ e.jsx(de, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: t("remove") })
96
97
  ] })
97
98
  ] })
98
99
  ] });
99
100
  }
100
101
  const ze = () => {
101
- const { t: s } = v(), l = W(() => Te(), []), [i, t] = xe(), [, u] = M(he), [d, c] = h(
102
- N(l, (r) => K(i, "providerKey").includes(r.providerKey))
103
- ), [k, p] = h(""), [C, g] = h(null), D = N(
102
+ const { t: s } = j(), l = Y(() => De(), []), [a, t] = me(), [, h] = M(xe), [d, c] = u(
103
+ N(l, (r) => K(a, "providerKey").includes(r.providerKey))
104
+ ), [k, p] = u(""), [C, g] = u(null), D = N(
104
105
  l.map((r) => K(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
105
- (r) => !$(r)
106
+ (r) => !G(r)
106
107
  ), T = (r) => {
107
- const m = q(l, { providerKey: r });
108
- c((a) => [...a, m]), t((a) => [...a, { providerKey: m.providerKey, args: {} }]), p(""), u("UNSAVED");
108
+ const m = $(l, { providerKey: r });
109
+ c((i) => [...i, m]), t((i) => [...i, { providerKey: m.providerKey, args: {} }]), p(""), h("UNSAVED");
109
110
  }, b = (r) => {
110
- c((m) => N(m, (a) => a.providerKey !== r.providerKey)), t((m) => N(m, (a) => a.providerKey !== r.providerKey)), u("UNSAVED");
111
+ c((m) => N(m, (i) => i.providerKey !== r.providerKey)), t((m) => N(m, (i) => i.providerKey !== r.providerKey)), h("UNSAVED");
111
112
  }, n = (r) => g(r);
112
- return G(l) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
113
+ return q(l) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
113
114
  s("no_data_providers"),
114
115
  /* @__PURE__ */ e.jsx("br", {}),
115
116
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
@@ -117,8 +118,8 @@ const ze = () => {
117
118
  /* @__PURE__ */ e.jsx("br", {}),
118
119
  /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
119
120
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ue, { value: k, onValueChange: (r) => T(r), children: [
120
- /* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(fe, { placeholder: s("select_provider") }) }),
121
- /* @__PURE__ */ e.jsxs(je, { children: [
121
+ /* @__PURE__ */ e.jsx(he, { className: "w-full", children: /* @__PURE__ */ e.jsx(pe, { placeholder: s("select_provider") }) }),
122
+ /* @__PURE__ */ e.jsxs(fe, { children: [
122
123
  /* @__PURE__ */ e.jsx(B, { value: "", children: s("choose") }),
123
124
  D.map((r) => /* @__PURE__ */ e.jsx(B, { value: r.value, children: r.label }, r.value))
124
125
  ] })
@@ -200,60 +201,60 @@ const ze = () => {
200
201
  /* @__PURE__ */ e.jsx(Be, { onClose: () => g(null), provider: C })
201
202
  ] })
202
203
  ] });
203
- }, Le = Y(() => {
204
- const { t: s } = v(), l = {
204
+ }, Le = Z(() => {
205
+ const { t: s } = j(), l = {
205
206
  "ctrl + Z": "Undo",
206
207
  "ctrl + Y": "Redo",
207
208
  "ctrl + D": "Duplicate"
208
- }, i = {
209
+ }, a = {
209
210
  // "ctrl + /": "Rename block",
210
211
  "ctrl + S": "Save page",
211
212
  esc: "Deselect blocks",
212
213
  del: "Delete block"
213
214
  };
214
215
  return /* @__PURE__ */ e.jsxs(O, { children: [
215
- /* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsxs(ge, { children: [
216
- /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(R, {}) }) }),
217
- /* @__PURE__ */ e.jsx(ye, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
216
+ /* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsxs(je, { children: [
217
+ /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(U, {}) }) }),
218
+ /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
218
219
  ] }) }),
219
220
  /* @__PURE__ */ e.jsxs(H, { className: "sm:max-w-[525px]", children: [
220
- /* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(F, { children: s("Keyboard shortcuts") }) }),
221
+ /* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children: s("Keyboard shortcuts") }) }),
221
222
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
222
223
  /* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(l).map((t) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
223
224
  /* @__PURE__ */ e.jsx(E, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(t) }),
224
225
  /* @__PURE__ */ e.jsx("div", { children: s(l[t]) })
225
226
  ] }, t)) }),
226
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(i).map((t) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
227
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(a).map((t) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
227
228
  /* @__PURE__ */ e.jsx(E, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(t) }),
228
- /* @__PURE__ */ e.jsx("div", { children: s(i[t]) })
229
+ /* @__PURE__ */ e.jsx("div", { children: s(a[t]) })
229
230
  ] }, t)) })
230
231
  ] }) })
231
232
  ] })
232
233
  ] });
233
- }), Ie = j(() => import("./AddBlocks-HeYXoex4.js")), P = j(() => import("./ListTree-0n_G8NJx.js")), Ve = j(() => import("./ThemeConfiguration-S7yArRMp.js")), Me = j(() => import("./ChaiBuilderEditor-tkzS851D.js").then((s) => s.cs)), Oe = j(() => import("./UILibrariesPanel-tcfz2ELp.js"));
234
+ }), Ie = v(() => import("./AddBlocks-05ZH2Suu.js")), S = v(() => import("./ListTree-KUGhFsb_.js")), Ve = v(() => import("./ThemeConfiguration-ab7lbA2y.js")), Me = v(() => import("./index-uLn8W3eR.js").then((s) => s.cy)), Oe = v(() => import("./UILibrariesPanel-5QxxXYg2.js"));
234
235
  let V = null;
235
- const Bs = () => {
236
- const s = w("sideBarComponents.top", []), l = w("sideBarComponents.bottom", []), [i, t] = M(Ne), [u, d] = h(i), [c, k] = h(null), { t: p } = v(), C = w("uiLibraries", []), g = _e(), D = Q(g).find((a) => a.category === "custom") !== void 0, T = C.length > 0 || D, b = {
236
+ const Es = () => {
237
+ const s = w("sideBarComponents.top", []), l = w("sideBarComponents.bottom", []), [a, t] = M(ye), [h, d] = u(a), [c, k] = u(null), { t: p } = j(), C = w("uiLibraries", []), g = Te(), D = Q(g).find((i) => i.category === "custom") !== void 0, T = C.length > 0 || D, b = {
237
238
  "add-blocks": Ie,
238
- [o]: P,
239
+ [o]: S,
239
240
  "theme-configuration": Ve,
240
241
  images: Me,
241
242
  "ui-libraries": Oe
242
243
  };
243
- X(s, ({ name: a, panel: _ }) => {
244
- b[a] = _;
244
+ X(s, ({ name: i, panel: A }) => {
245
+ b[i] = A;
245
246
  });
246
- const n = (a) => {
247
- clearTimeout(V), i !== o && a === o ? V = setTimeout(() => t(o), 500) : d(a), t(a);
247
+ const n = (i) => {
248
+ clearTimeout(V), a !== o && i === o ? V = setTimeout(() => t(o), 500) : d(i), t(i);
248
249
  }, r = w("dataBindingSupport", !1);
249
250
  function m() {
250
- const a = setTimeout(() => {
251
+ const i = setTimeout(() => {
251
252
  c && (n(o), clearTimeout(c));
252
253
  }, 500);
253
- k(a);
254
+ k(i);
254
255
  }
255
256
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
256
- i !== o ? /* @__PURE__ */ e.jsx(
257
+ a !== o ? /* @__PURE__ */ e.jsx(
257
258
  "div",
258
259
  {
259
260
  onMouseEnter: m,
@@ -269,8 +270,8 @@ const Bs = () => {
269
270
  {
270
271
  onClick: () => n("add-blocks"),
271
272
  size: "sm",
272
- variant: i === "add-blocks" ? "default" : "outline",
273
- children: /* @__PURE__ */ e.jsx(S, { className: "text-xl" })
273
+ variant: a === "add-blocks" ? "default" : "outline",
274
+ children: /* @__PURE__ */ e.jsx(_, { className: "text-xl" })
274
275
  }
275
276
  ),
276
277
  /* @__PURE__ */ e.jsx(
@@ -278,7 +279,7 @@ const Bs = () => {
278
279
  {
279
280
  onClick: () => n("ui-libraries"),
280
281
  size: "sm",
281
- variant: i === "ui-libraries" ? "default" : "outline",
282
+ variant: a === "ui-libraries" ? "default" : "outline",
282
283
  children: /* @__PURE__ */ e.jsx(J, { className: "text-xl" })
283
284
  }
284
285
  )
@@ -287,8 +288,8 @@ const Bs = () => {
287
288
  {
288
289
  onClick: () => n("add-blocks"),
289
290
  size: "sm",
290
- variant: i === "add-blocks" ? "default" : "outline",
291
- children: /* @__PURE__ */ e.jsx(S, { className: "text-xl" })
291
+ variant: a === "add-blocks" ? "default" : "outline",
292
+ children: /* @__PURE__ */ e.jsx(_, { className: "text-xl" })
292
293
  }
293
294
  ),
294
295
  /* @__PURE__ */ e.jsx(
@@ -296,8 +297,8 @@ const Bs = () => {
296
297
  {
297
298
  onClick: () => n(o),
298
299
  size: "sm",
299
- variant: i === o ? "default" : "outline",
300
- children: /* @__PURE__ */ e.jsx(A, { className: "w-4" })
300
+ variant: a === o ? "default" : "outline",
301
+ children: /* @__PURE__ */ e.jsx(P, { className: "w-4" })
301
302
  }
302
303
  ),
303
304
  /* @__PURE__ */ e.jsx(
@@ -305,19 +306,19 @@ const Bs = () => {
305
306
  {
306
307
  onClick: () => n("theme-configuration"),
307
308
  size: "sm",
308
- variant: i === "theme-configuration" ? "default" : "outline",
309
- children: /* @__PURE__ */ e.jsx(Ce, { className: "w-4 max-w-[40px] text-xs" })
309
+ variant: a === "theme-configuration" ? "default" : "outline",
310
+ children: /* @__PURE__ */ e.jsx(ke, { className: "w-4 max-w-[40px] text-xs" })
310
311
  }
311
312
  ),
312
313
  f.Children.toArray(
313
- s.map(({ name: a, icon: _ }) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
314
+ s.map(({ name: i, icon: A }) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
314
315
  x,
315
316
  {
316
- onClick: () => n(a),
317
+ onClick: () => n(i),
317
318
  size: "sm",
318
319
  className: "w-10",
319
- variant: i === a ? "default" : "outline",
320
- children: /* @__PURE__ */ e.jsx(_, {})
320
+ variant: a === i ? "default" : "outline",
321
+ children: /* @__PURE__ */ e.jsx(A, {})
321
322
  }
322
323
  ) }))
323
324
  )
@@ -325,11 +326,11 @@ const Bs = () => {
325
326
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
326
327
  /* @__PURE__ */ e.jsx(Le, {}),
327
328
  f.Children.toArray(
328
- l.map((a) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(a, {}) }))
329
+ l.map((i) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(i, {}) }))
329
330
  )
330
331
  ] })
331
332
  ] }),
332
- i !== o ? /* @__PURE__ */ e.jsx(
333
+ a !== o ? /* @__PURE__ */ e.jsx(
333
334
  "div",
334
335
  {
335
336
  className: "absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
@@ -350,7 +351,7 @@ const Bs = () => {
350
351
  onMouseEnter: () => {
351
352
  c && clearTimeout(c);
352
353
  },
353
- children: f.createElement(ee(b, i, () => /* @__PURE__ */ e.jsx("div", {})))
354
+ children: f.createElement(ee(b, a, () => /* @__PURE__ */ e.jsx("div", {})))
354
355
  }
355
356
  )
356
357
  }
@@ -365,32 +366,32 @@ const Bs = () => {
365
366
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
366
367
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
367
368
  ] }),
368
- children: r ? /* @__PURE__ */ e.jsxs(we, { defaultValue: o, className: "flex h-full w-full flex-col py-1", children: [
369
- /* @__PURE__ */ e.jsxs(ke, { className: "mx-1 grid h-10 grid-cols-2", children: [
369
+ children: r ? /* @__PURE__ */ e.jsxs(Ne, { defaultValue: o, className: "flex h-full w-full flex-col py-1", children: [
370
+ /* @__PURE__ */ e.jsxs(we, { className: "mx-1 grid h-10 grid-cols-2", children: [
370
371
  /* @__PURE__ */ e.jsxs(L, { value: o, children: [
371
- /* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
372
+ /* @__PURE__ */ e.jsx(P, { className: "mr-2 h-3" }),
372
373
  " ",
373
374
  p("Outline")
374
375
  ] }),
375
376
  /* @__PURE__ */ e.jsxs(L, { value: "data-provider", children: [
376
- /* @__PURE__ */ e.jsx(De, { className: "mr-2 w-3" }),
377
+ /* @__PURE__ */ e.jsx(Ce, { className: "mr-2 w-3" }),
377
378
  p("Data")
378
379
  ] })
379
380
  ] }),
380
- /* @__PURE__ */ e.jsx(I, { value: o, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(P) }),
381
+ /* @__PURE__ */ e.jsx(I, { value: o, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(S) }),
381
382
  /* @__PURE__ */ e.jsx(I, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ze, {}) })
382
383
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
383
384
  /* @__PURE__ */ e.jsxs("div", { className: "sticky top-0 -m-1 flex h-fit items-center justify-center border-b bg-gray-100 py-2 pb-[9px] text-sm", children: [
384
- /* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
385
+ /* @__PURE__ */ e.jsx(P, { className: "mr-2 h-3" }),
385
386
  " ",
386
387
  p("Outline")
387
388
  ] }),
388
- /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2", children: f.createElement(P) })
389
+ /* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2", children: f.createElement(S) })
389
390
  ] })
390
391
  }
391
392
  ) })
392
393
  ] });
393
394
  };
394
395
  export {
395
- Bs as default
396
+ Es as default
396
397
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),R=require("@radix-ui/react-icons"),i=require("react"),D=require("jotai"),c=require("lodash-es"),s=require("./index-0FIxW0gR.cjs"),E=require("lucide-react"),S=require("@chaibuilder/runtime"),v=require("react-i18next"),T=require("./index-gi1LIOCw.cjs"),P=require("./index-sspgZwTk.cjs"),a=require("./MODIFIERS-mVmfEGgo.cjs"),I=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.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("@react-hookz/web");require("tree-model");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./index--mLLy7QQ.cjs");const _=({provider:t,onClose:x})=>{const{t:o}=v.useTranslation(),[l,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(d=>p(d))},[t]),t?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:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(P.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(T.JsonView,{data:l,shouldExpandNode:T.allExpanded,style:{...T.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 K({children:t,name:x,onRemove:o}){const{t:l}=v.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:l("remove_provider_confirmation").replace("{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:o,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const L=()=>{const{t}=v.useTranslation(),x=i.useMemo(()=>S.getChaiDataProviders(),[]),[o,l]=s.usePageDataProviders(),[,p]=D.useAtom(s.builderSaveStateAtom),[m,d]=i.useState(c.filter(x,r=>c.map(o,"providerKey").includes(r.providerKey))),[b,h]=i.useState(""),[N,f]=i.useState(null),y=c.filter(x.map(r=>c.map(m,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!c.isNull(r)),w=r=>{const j=c.find(x,{providerKey:r});d(n=>[...n,j]),l(n=>[...n,{providerKey:j.providerKey,args:{}}]),h(""),p("UNSAVED")},g=r=>{d(j=>c.filter(j,n=>n.providerKey!==r.providerKey)),l(j=>c.filter(j,n=>n.providerKey!==r.providerKey)),p("UNSAVED")},u=r=>f(r);return c.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:b,onValueChange:r=>w(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")}),y.map(r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${m.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[t("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:m.map(r=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:r.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:r.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>u(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(K,{onRemove:()=>g(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(_,{onClose:()=>f(null),provider:N})]})]})},B=i.memo(()=>{const{t}=v.useTranslation(),x={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx("div",{className:"flex w-10 items-center justify-center",children:e.jsxRuntimeExports.jsx(R.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(x).map(l=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(l)}),e.jsxRuntimeExports.jsx("div",{children:t(x[l])})]},l))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(l=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(l)}),e.jsxRuntimeExports.jsx("div",{children:t(o[l])})]},l))})]})})]})]})}),A=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-MH_fqSRf.cjs"))),k=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-A-097CZ-.cjs"))),O=i.lazy(()=>Promise.resolve().then(()=>require("./ThemeConfiguration-PvMN3j6h.cjs"))),U=i.lazy(()=>Promise.resolve().then(()=>require("./index-0FIxW0gR.cjs")).then(t=>t.ImagesPanel)),z=i.lazy(()=>Promise.resolve().then(()=>require("./UILibrariesPanel-r8nQzXQ-.cjs")));let C=null;const Y=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[o,l]=D.useAtom(s.activePanelAtom),[p,m]=i.useState(o),[d,b]=i.useState(null),{t:h}=v.useTranslation(),N=s.useBuilderProp("uiLibraries",[]),f=S.useChaiBlocks(),y=c.values(f).find(n=>n.category==="custom")!==void 0,w=N.length>0||y,g={"add-blocks":A,[a.OUTLINE_KEY]:k,"theme-configuration":O,images:U,"ui-libraries":z};c.each(t,({name:n,panel:q})=>{g[n]=q});const u=n=>{clearTimeout(C),o!==a.OUTLINE_KEY&&n===a.OUTLINE_KEY?C=setTimeout(()=>l(a.OUTLINE_KEY),500):m(n),l(n)},r=s.useBuilderProp("dataBindingSupport",!1);function j(){const n=setTimeout(()=>{d&&(u(a.OUTLINE_KEY),clearTimeout(d))},500);b(n)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[o!==a.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:j,onClick:()=>u(a.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:[w?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:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(R.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("ui-libraries"),size:"sm",variant:o==="ui-libraries"?"default":"outline",children:e.jsxRuntimeExports.jsx(R.Component2Icon,{className:"text-xl"})})]}):e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("add-blocks"),size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(R.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u(a.OUTLINE_KEY),size:"sm",variant:o===a.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:o==="theme-configuration"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.PaletteIcon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:n,icon:q})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u(n),size:"sm",className:"w-10",variant:o===n?"default":"outline",children:e.jsxRuntimeExports.jsx(q,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(B,{}),i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]}),o!==a.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:I.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(c.get(g,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}):null,e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:r?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:a.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:a.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:a.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(k)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(L,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sticky top-0 -m-1 flex h-fit items-center justify-center border-b bg-gray-100 py-2 pb-[9px] text-sm",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2",children:i.createElement(k)})]})})})]})};exports.default=Y;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),B=require("react"),N=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./index-0FIxW0gR.cjs"),r=require("./controls-rRZhz0vu.cjs"),m=require("lodash-es"),k=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.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-icons");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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");function P(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 f=P(B),T=({value:t,onChange:e,id:i,onBlur:l})=>{const n=m.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})})})},g=[{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"}],D=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",m.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=f.useRef(e),{t:v}=k.useTranslation();f.useEffect(()=>()=>{m.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:R}=e;let s={headingFont:r.f({title:"Heading font",default:b,options:g}),bodyFont:r.f({title:"Body font",default:q,options:g}),roundedCorners:r.y({title:"Rounded Corner",default:parseInt(R||5,10)}),primaryColor:r.s({title:"Primary",default:h}),secondaryColor:r.s({title:"Secondary",default:j})};l||(s={...s,bodyBgLightColor:r.s({title:"Background",default:O}),bodyTextLightColor:r.s({title:"Text color",default:y}),bodyBgDarkColor:r.s({title:"Background (Dark mode)",default:S}),bodyTextDarkColor:r.s({title:"Text color(Dark mode)",default:C})});const c={type:"object",properties:{}},x={};return Object.keys(s).forEach(o=>{const d=s[o];return c.properties||(c.properties={}),c.properties[o]=d.schema,x[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:T},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:x,schema:c,formData:e,validator:N,onChange:u})})]})};exports.default=D;
@@ -2,27 +2,17 @@ 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 T, G as w, by as D } from "./ChaiBuilderEditor-tkzS851D.js";
5
+ import { h as T, X as w, bH as D } from "./index-uLn8W3eR.js";
6
6
  import { f, y as P, s as a } from "./controls-yjgoZzB6.js";
7
7
  import { debounce as R, noop as M, isEqual as F } from "lodash-es";
8
8
  import { useTranslation as L } from "react-i18next";
9
9
  import "./_commonjsHelpers-UyOWmZb0.js";
10
- import "clsx";
11
- import "react-dom";
12
- import "@radix-ui/react-scroll-area";
13
- import "@floating-ui/react-dom";
14
- import "jotai";
15
- import "i18next";
16
- import "flagged";
17
- import "./MODIFIERS-fd5XOmum.js";
18
- import "./Functions-7jnEwJyw.js";
19
- import "tailwind-merge";
20
- import "@chaibuilder/runtime";
21
- import "@react-hookz/web";
22
- import "tree-model";
23
- import "./utils-VpVqnC9m.js";
24
10
  import "@radix-ui/react-toggle";
25
11
  import "class-variance-authority";
12
+ import "./utils-VpVqnC9m.js";
13
+ import "./MODIFIERS-fd5XOmum.js";
14
+ import "clsx";
15
+ import "tailwind-merge";
26
16
  import "@radix-ui/react-switch";
27
17
  import "@radix-ui/react-slot";
28
18
  import "@radix-ui/react-accordion";
@@ -30,6 +20,7 @@ import "@radix-ui/react-icons";
30
20
  import "@radix-ui/react-alert-dialog";
31
21
  import "@radix-ui/react-dialog";
32
22
  import "@radix-ui/react-label";
23
+ import "@radix-ui/react-scroll-area";
33
24
  import "@radix-ui/react-tabs";
34
25
  import "@radix-ui/react-tooltip";
35
26
  import "@radix-ui/react-popover";
@@ -42,10 +33,13 @@ import "@radix-ui/react-toast";
42
33
  import "cmdk";
43
34
  import "@radix-ui/react-context-menu";
44
35
  import "react-icons-picker";
36
+ import "react-dom";
45
37
  import "react-quill";
46
- import "react-hotkeys-hook";
47
- import "lucide-react";
48
- import "./index-VBXQixVm.js";
38
+ import "./Functions-7jnEwJyw.js";
39
+ import "@chaibuilder/runtime";
40
+ import "jotai";
41
+ import "@react-hookz/web";
42
+ import "tree-model";
49
43
  const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
50
44
  const i = R(e, 200), d = (l) => i(l.target.value);
51
45
  return /* @__PURE__ */ t.jsx("div", { className: "mt-1.5 flex items-center gap-x-3", children: /* @__PURE__ */ t.jsx("div", { className: "flex w-3/5 flex-col", children: /* @__PURE__ */ t.jsx(
@@ -110,7 +104,7 @@ const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
110
104
  { title: "Suranna", value: "Suranna" },
111
105
  { title: "Bebas Neue", value: "Bebas Neue" },
112
106
  { title: "Manrope", value: "Manrope" }
113
- ], Dt = () => {
107
+ ], Ot = () => {
114
108
  const u = T("onSaveBrandingOptions", M), [e, p] = w(), [m] = D(), i = c.useRef(e), { t: d } = L();
115
109
  c.useEffect(() => () => {
116
110
  F(e, i.current) || u(i.current);
@@ -121,8 +115,8 @@ const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
121
115
  bodyFont: h,
122
116
  headingFont: b,
123
117
  primaryColor: x,
124
- bodyTextDarkColor: y,
125
- bodyTextLightColor: C,
118
+ bodyTextDarkColor: C,
119
+ bodyTextLightColor: y,
126
120
  bodyBgDarkColor: S,
127
121
  secondaryColor: B,
128
122
  bodyBgLightColor: O,
@@ -154,7 +148,7 @@ const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
154
148
  }),
155
149
  bodyTextLightColor: a({
156
150
  title: "Text color",
157
- default: y
151
+ default: C
158
152
  }),
159
153
  bodyBgDarkColor: a({
160
154
  title: "Background (Dark mode)",
@@ -162,7 +156,7 @@ const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
162
156
  }),
163
157
  bodyTextDarkColor: a({
164
158
  title: "Text color(Dark mode)",
165
- default: C
159
+ default: y
166
160
  })
167
161
  });
168
162
  const n = {
@@ -193,5 +187,5 @@ const E = ({ value: u, onChange: e, id: p, onBlur: m }) => {
193
187
  ] });
194
188
  };
195
189
  export {
196
- Dt as default
190
+ Ot as default
197
191
  };
@@ -0,0 +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("./index-0FIxW0gR.cjs"),p=require("./index-sspgZwTk.cjs"),l=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");const m=()=>r.useBuilderProp("languages",["en"]),j=()=>m().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"})]})})]})}),d=()=>{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(p.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})},h=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},q=()=>{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(j,{}),e.jsxRuntimeExports.jsx(h,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),x?e.jsxRuntimeExports.jsx(d,{}):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=q;