@chaibuilder/sdk 1.2.22 → 1.2.24

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 (107) hide show
  1. package/dist/AddBlocks-l1JENNvq.js +206 -0
  2. package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
  3. package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
  4. package/dist/{BrandingOptions-4961TxX2.js → BrandingOptions-udtH5yJs.js} +11 -10
  5. package/dist/CanvasArea-IqeMbtOf.js +951 -0
  6. package/dist/CanvasArea-plZTWifU.cjs +55 -0
  7. package/dist/{Class-MmCxz2Ay.cjs → Class-PoYusiA5.cjs} +1 -1
  8. package/dist/{Class-3k8xjeiM.js → Class-lGzsNBOK.js} +1 -1
  9. package/dist/CurrentPage-7_s9LtEJ.cjs +1 -0
  10. package/dist/{CurrentPage-oPZN6Gwj.js → CurrentPage-AA0XHYMU.js} +23 -24
  11. package/dist/ListTree-LAN7QmHQ.cjs +1 -0
  12. package/dist/ListTree-ZNEtds1d.js +309 -0
  13. package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
  14. package/dist/{MODIFIERS-WQdaNvb8.js → MODIFIERS-dytZ-osO.js} +4 -8
  15. package/dist/PagesPanel-5qMZBatP.cjs +1 -0
  16. package/dist/{PagesPanel-pRKHw-AZ.js → PagesPanel-883P3_su.js} +9 -10
  17. package/dist/{ProjectPanel-iU6DY-Yp.js → ProjectPanel-Y8Qcmsn0.js} +11 -12
  18. package/dist/ProjectPanel-otQb9ceP.cjs +1 -0
  19. package/dist/STRINGS--j49GZJP.js +7 -0
  20. package/dist/STRINGS-gPz7CUOk.cjs +1 -0
  21. package/dist/Settings-Rt342VJ3.cjs +1 -0
  22. package/dist/{Settings-BhSrj-cE.js → Settings-pIePR1Id.js} +862 -865
  23. package/dist/{SidePanels-OLOUpKn4.js → SidePanels-NznSn5RN.js} +121 -125
  24. package/dist/SidePanels-PaQkgjLa.cjs +1 -0
  25. package/dist/Topbar-CqW7G360.cjs +1 -0
  26. package/dist/{Topbar-Ny9T-7Zb.js → Topbar-pWzBEOed.js} +39 -35
  27. package/dist/UnsplashImages-NGskB93R.cjs +1 -0
  28. package/dist/{UnsplashImages-Y8RGFVSh.js → UnsplashImages-qvwFbV-E.js} +17 -16
  29. package/dist/{UploadImages-dd8LfyFr.js → UploadImages-9NapgXBq.js} +12 -11
  30. package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
  31. package/dist/{add-page-modal-Jni6CY1x.js → add-page-modal-4PiRJgX5.js} +11 -12
  32. package/dist/add-page-modal-4o2L_7T7.cjs +1 -0
  33. package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
  34. package/dist/{confirm-alert-sc8RaWvD.js → confirm-alert-GUhZ_G8w.js} +7 -6
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.d.ts +5 -3
  37. package/dist/core.js +48 -49
  38. package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
  39. package/dist/{defaultTheme-gunU_Fe5.js → defaultTheme-D8B4-wHO.js} +1 -1
  40. package/dist/{delete-page-modal-0WiMZFxr.js → delete-page-modal-4l5-RhQB.js} +10 -11
  41. package/dist/delete-page-modal-Bek5bCf-.cjs +1 -0
  42. package/dist/email.cjs +1 -1
  43. package/dist/email.d.ts +3 -1
  44. package/dist/email.js +16 -16
  45. package/dist/{form-Nj6Kdn3g.js → form-STUz-6nE.js} +1 -1
  46. package/dist/{form-n1Q6u16z.cjs → form-lBQ_76Uw.cjs} +1 -1
  47. package/dist/html-to-json-efmv1pCj.cjs +1 -0
  48. package/dist/{html-to-json-C5sExaSD.js → html-to-json-ngX9ef2u.js} +31 -29
  49. package/dist/{index-IPJAbzzO.js → index-Gk6sASBd.js} +1242 -1213
  50. package/dist/{index-0bwkNnA0.cjs → index-dgm-fd8U.cjs} +42 -42
  51. package/dist/{index-UP_4awU9.js → index-gS-3liKK.js} +4479 -4484
  52. package/dist/index-h-hd6EvN.cjs +1 -0
  53. package/dist/index-oCYKBYyT.cjs +1 -0
  54. package/dist/{index-_VPpjzJu.js → index-xZWaF8AW.js} +118 -119
  55. package/dist/lib.cjs +3 -3
  56. package/dist/lib.js +17 -16
  57. package/dist/page-viewer-JlKEwACu.cjs +1 -0
  58. package/dist/{page-viewer-L1Dmgj-c.js → page-viewer-rCXavxpd.js} +15 -16
  59. package/dist/project-general-setting-2FGoUZ-z.cjs +1 -0
  60. package/dist/{project-general-setting-sUP7JqWK.js → project-general-setting-rmAVpDu9.js} +11 -12
  61. package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
  62. package/dist/{project-seo-setting-NNvAGt4T.js → project-seo-setting-pX34Qsym.js} +8 -7
  63. package/dist/render.cjs +1 -1
  64. package/dist/render.js +14 -13
  65. package/dist/single-page-detail-c6-wRWyN.cjs +1 -0
  66. package/dist/{single-page-detail-FXg_NebW.js → single-page-detail-rSQomrY5.js} +12 -13
  67. package/dist/studio.cjs +1 -1
  68. package/dist/studio.d.ts +3 -1
  69. package/dist/studio.js +8 -9
  70. package/dist/ui.cjs +1 -1
  71. package/dist/ui.js +139 -138
  72. package/dist/web-blocks.cjs +6 -1
  73. package/dist/web-blocks.js +462 -354
  74. package/package.json +3 -5
  75. package/dist/AddBlocks-157fSrJX.cjs +0 -1
  76. package/dist/AddBlocks-WgpssWmQ.js +0 -223
  77. package/dist/BrandingOptions-nwXR9TMl.cjs +0 -1
  78. package/dist/CanvasArea-MajWGr9z.js +0 -908
  79. package/dist/CanvasArea-MmTlc5Vb.cjs +0 -55
  80. package/dist/CurrentPage-LpLr0lDI.cjs +0 -1
  81. package/dist/ListTree-dvxHTXs4.js +0 -167
  82. package/dist/ListTree-gTmusfso.cjs +0 -1
  83. package/dist/MODIFIERS-9EwxLM8V.cjs +0 -1
  84. package/dist/Outline-2OxsXs1-.js +0 -294
  85. package/dist/Outline-7CCnnzmK.cjs +0 -1
  86. package/dist/PagesPanel-8536oBWB.cjs +0 -1
  87. package/dist/ProjectPanel-oILsUWOH.cjs +0 -1
  88. package/dist/Settings-jHiYmt0y.cjs +0 -1
  89. package/dist/SidePanels-bcJJocSq.cjs +0 -1
  90. package/dist/Topbar-NMvzqQHW.cjs +0 -1
  91. package/dist/TypeIcon-ElNNPazl.cjs +0 -1
  92. package/dist/TypeIcon-qO96rNbV.js +0 -69
  93. package/dist/UnsplashImages-6tZv1q2_.cjs +0 -1
  94. package/dist/UploadImages-VLlVg9Ur.cjs +0 -1
  95. package/dist/add-page-modal-IsqDdK7X.cjs +0 -1
  96. package/dist/confirm-alert-f26zJ7Js.cjs +0 -1
  97. package/dist/defaultTheme-7Lk2zq60.cjs +0 -1
  98. package/dist/delete-page-modal-c3b-GCap.cjs +0 -1
  99. package/dist/html-to-json-FGufPv9R.cjs +0 -1
  100. package/dist/index-9PHdn80L.cjs +0 -1
  101. package/dist/index-nwAgi0aD.cjs +0 -1
  102. package/dist/page-viewer-TnxHhq7S.cjs +0 -1
  103. package/dist/project-general-setting-1Ot1RU43.cjs +0 -1
  104. package/dist/project-seo-setting-3-vBkx2v.cjs +0 -1
  105. package/dist/single-page-detail-btEKYXjE.cjs +0 -1
  106. package/dist/useAddBlockByDrop-V8xo-PNQ.js +0 -20
  107. package/dist/useAddBlockByDrop-qRHgy8_0.cjs +0 -1
@@ -1,24 +1,24 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { KeyboardIcon as J, PlusIcon as q, Half2Icon as Y } from "@radix-ui/react-icons";
3
- import v, { useState as p, useEffect as Z, useMemo as $, lazy as b, Suspense as y } from "react";
4
- import { useAtom as H } from "jotai";
5
- import { filter as w, map as E, isNull as G, find as Q, isEmpty as W, each as X, get as ee } from "lodash-es";
6
- import { ad as F, ae as L, af as R, ag as U, ah as se, A as re, a as ae, b as le, c as ie, d as te, e as oe, f as ne, g as ce, ai as de, y as me, C as xe, aj as pe, ak as he, al as ue, am as fe, an as B, ao as je, ap as ve, aq as ge, B as g, ar as be, as as z, h as T, at as Ne, S as V, au as O, av as I, aw as A, ax as S } from "./index-IPJAbzzO.js";
7
- import { ListTreeIcon as _, DatabaseIcon as ye } from "lucide-react";
8
- import { getChaiDataProviders as we } from "@chaibuilder/runtime";
9
- import { useTranslation as N } from "react-i18next";
10
- import { J as ke, a as Ce, d as De } from "./index-e0c8PmRQ.js";
11
- import { E as Te } from "./index-UP_4awU9.js";
12
- import { c as Ae } from "./Functions-7jnEwJyw.js";
13
- import { O as i } from "./MODIFIERS-WQdaNvb8.js";
14
- import { useFeature as Se } from "flagged";
2
+ import { KeyboardIcon as U, PlusIcon as J, Half2Icon as q } from "@radix-ui/react-icons";
3
+ import j, { useState as p, useEffect as W, useMemo as Y, lazy as w, Suspense as N } from "react";
4
+ import { useAtom as O } from "jotai";
5
+ import { filter as y, map as K, isNull as Z, find as $, isEmpty as G, each as Q, get as X } from "lodash-es";
6
+ import { ad as M, ae as H, af as F, ag as R, ah as ee, A as se, a as re, b as ae, c as le, d as ie, e as te, f as oe, g as ne, ai as ce, y as de, C as me, aj as xe, ak as pe, al as he, am as ue, an as E, ao as fe, ap as je, aq as ve, B as v, ar as ge, as as B, h as T, at as be, S as z, au as V, av as I, aw as A, ax as S } from "./index-Gk6sASBd.js";
7
+ import { ListTreeIcon as _, DatabaseIcon as Ne } from "lucide-react";
8
+ import { getChaiDataProviders as ye } from "@chaibuilder/runtime";
9
+ import { useTranslation as g } from "react-i18next";
10
+ import { J as we, a as ke, d as Ce } from "./index-e0c8PmRQ.js";
11
+ import { E as De } from "./index-gS-3liKK.js";
12
+ import { O as i } from "./STRINGS--j49GZJP.js";
13
+ import { c as Te } from "./Functions-7jnEwJyw.js";
15
14
  import "./_commonjsHelpers-UyOWmZb0.js";
16
15
  import "@react-hookz/web";
17
- import "@radix-ui/react-toggle";
18
- import "class-variance-authority";
19
- import "./Class-3k8xjeiM.js";
16
+ import "./MODIFIERS-dytZ-osO.js";
17
+ import "./Class-lGzsNBOK.js";
20
18
  import "clsx";
21
19
  import "tailwind-merge";
20
+ import "@radix-ui/react-toggle";
21
+ import "class-variance-authority";
22
22
  import "@radix-ui/react-switch";
23
23
  import "@radix-ui/react-slot";
24
24
  import "@radix-ui/react-accordion";
@@ -42,29 +42,28 @@ import "react-dom";
42
42
  import "react-quill";
43
43
  import "i18next";
44
44
  import "@floating-ui/react-dom";
45
- import "react-dnd";
46
- import "@minoru/react-dnd-treeview";
45
+ import "flagged";
47
46
  import "react-hotkeys-hook";
48
- const _e = ({ provider: s, onClose: o }) => {
49
- const { t: l } = N(), [a, h] = p(null);
50
- return Z(() => {
47
+ const Ae = ({ provider: s, onClose: o }) => {
48
+ const { t: l } = g(), [a, h] = p(null);
49
+ return W(() => {
51
50
  s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => h(n));
52
- }, [s]), s ? /* @__PURE__ */ e.jsx(F, { onOpenChange: (c) => c ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(L, { children: [
53
- /* @__PURE__ */ e.jsxs(R, { children: [
54
- /* @__PURE__ */ e.jsxs(U, { children: [
51
+ }, [s]), s ? /* @__PURE__ */ e.jsx(M, { onOpenChange: (d) => d ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(H, { children: [
52
+ /* @__PURE__ */ e.jsxs(F, { children: [
53
+ /* @__PURE__ */ e.jsxs(R, { children: [
55
54
  l("data_provider"),
56
55
  ": ",
57
56
  s.name
58
57
  ] }),
59
- /* @__PURE__ */ e.jsx(se, { children: s.description })
58
+ /* @__PURE__ */ e.jsx(ee, { children: s.description })
60
59
  ] }),
61
- /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsx(
62
- ke,
60
+ /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(
61
+ we,
63
62
  {
64
63
  data: a,
65
- shouldExpandNode: Ce,
64
+ shouldExpandNode: ke,
66
65
  style: {
67
- ...De,
66
+ ...Ce,
68
67
  container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
69
68
  stringValue: "text-orange-600",
70
69
  label: "text-green-900 font-semibold pr-1 tracking-wider"
@@ -73,64 +72,64 @@ const _e = ({ provider: s, onClose: o }) => {
73
72
  ) })
74
73
  ] }) }) : null;
75
74
  };
76
- function Pe({
75
+ function Se({
77
76
  children: s,
78
77
  name: o,
79
78
  onRemove: l
80
79
  }) {
81
- const { t: a } = N();
82
- return /* @__PURE__ */ e.jsxs(re, { children: [
83
- /* @__PURE__ */ e.jsx(ae, { asChild: !0, children: s }),
84
- /* @__PURE__ */ e.jsxs(le, { children: [
85
- /* @__PURE__ */ e.jsxs(ie, { children: [
80
+ const { t: a } = g();
81
+ return /* @__PURE__ */ e.jsxs(se, { children: [
82
+ /* @__PURE__ */ e.jsx(re, { asChild: !0, children: s }),
83
+ /* @__PURE__ */ e.jsxs(ae, { children: [
84
+ /* @__PURE__ */ e.jsxs(le, { children: [
86
85
  /* @__PURE__ */ e.jsx(
87
- te,
86
+ ie,
88
87
  {
89
88
  dangerouslySetInnerHTML: { __html: a("remove_provider_confirmation").replace("{name}", o) }
90
89
  }
91
90
  ),
92
- /* @__PURE__ */ e.jsx(oe, { children: a("remove_provider_warning") })
91
+ /* @__PURE__ */ e.jsx(te, { children: a("remove_provider_warning") })
93
92
  ] }),
94
- /* @__PURE__ */ e.jsxs(ne, { children: [
95
- /* @__PURE__ */ e.jsx(ce, { children: a("cancel") }),
96
- /* @__PURE__ */ e.jsx(de, { onClick: l, className: "bg-red-600 hover:bg-red-700", children: a("remove") })
93
+ /* @__PURE__ */ e.jsxs(oe, { children: [
94
+ /* @__PURE__ */ e.jsx(ne, { children: a("cancel") }),
95
+ /* @__PURE__ */ e.jsx(ce, { onClick: l, className: "bg-red-600 hover:bg-red-700", children: a("remove") })
97
96
  ] })
98
97
  ] })
99
98
  ] });
100
99
  }
101
- const Ke = () => {
102
- const { t: s } = N(), o = $(() => we(), []), [l, a] = me(), [, h] = H(xe), [c, n] = p(
103
- w(o, (r) => E(l, "providerKey").includes(r.providerKey))
104
- ), [k, u] = p(""), [f, j] = p(null), d = w(
105
- o.map((r) => E(c, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
106
- (r) => !G(r)
107
- ), C = (r) => {
108
- const x = Q(o, { providerKey: r });
100
+ const _e = () => {
101
+ const { t: s } = g(), o = Y(() => ye(), []), [l, a] = de(), [, h] = O(me), [d, n] = p(
102
+ y(o, (r) => K(l, "providerKey").includes(r.providerKey))
103
+ ), [k, u] = p(""), [b, c] = p(null), C = y(
104
+ o.map((r) => K(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
105
+ (r) => !Z(r)
106
+ ), D = (r) => {
107
+ const x = $(o, { providerKey: r });
109
108
  n((m) => [...m, x]), a((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""), h("UNSAVED");
110
- }, D = (r) => {
111
- n((x) => w(x, (m) => m.providerKey !== r.providerKey)), a((x) => w(x, (m) => m.providerKey !== r.providerKey)), h("UNSAVED");
112
- }, t = (r) => j(r);
113
- return W(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
109
+ }, t = (r) => {
110
+ n((x) => y(x, (m) => m.providerKey !== r.providerKey)), a((x) => y(x, (m) => m.providerKey !== r.providerKey)), h("UNSAVED");
111
+ }, f = (r) => c(r);
112
+ return G(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
114
113
  s("no_data_providers"),
115
114
  /* @__PURE__ */ e.jsx("br", {}),
116
115
  /* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
117
116
  ] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
118
117
  /* @__PURE__ */ e.jsx("br", {}),
119
118
  /* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
120
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(pe, { value: k, onValueChange: (r) => C(r), children: [
121
- /* @__PURE__ */ e.jsx(he, { className: "w-full", children: /* @__PURE__ */ e.jsx(ue, { placeholder: s("select_provider") }) }),
122
- /* @__PURE__ */ e.jsxs(fe, { children: [
123
- /* @__PURE__ */ e.jsx(B, { value: "", children: s("choose") }),
124
- d.map((r) => /* @__PURE__ */ e.jsx(B, { value: r.value, children: r.label }, r.value))
119
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(xe, { value: k, onValueChange: (r) => D(r), children: [
120
+ /* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(he, { placeholder: s("select_provider") }) }),
121
+ /* @__PURE__ */ e.jsxs(ue, { children: [
122
+ /* @__PURE__ */ e.jsx(E, { value: "", children: s("choose") }),
123
+ C.map((r) => /* @__PURE__ */ e.jsx(E, { value: r.value, children: r.label }, r.value))
125
124
  ] })
126
125
  ] }) }),
127
126
  /* @__PURE__ */ e.jsx("br", {}),
128
- /* @__PURE__ */ e.jsxs("div", { className: `border-t ${c.length ? "block" : "hidden"}`, children: [
127
+ /* @__PURE__ */ e.jsxs("div", { className: `border-t ${d.length ? "block" : "hidden"}`, children: [
129
128
  /* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
130
129
  s("page_data_providers"),
131
130
  ":"
132
131
  ] }),
133
- /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: c.map((r) => /* @__PURE__ */ e.jsxs(
132
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: d.map((r) => /* @__PURE__ */ e.jsxs(
134
133
  "div",
135
134
  {
136
135
  className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
@@ -144,7 +143,7 @@ const Ke = () => {
144
143
  /* @__PURE__ */ e.jsxs(
145
144
  "button",
146
145
  {
147
- onClick: () => t(r),
146
+ onClick: () => f(r),
148
147
  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",
149
148
  children: [
150
149
  /* @__PURE__ */ e.jsxs(
@@ -156,9 +155,9 @@ const Ke = () => {
156
155
  viewBox: "0 0 24 24",
157
156
  fill: "none",
158
157
  stroke: "currentColor",
159
- "stroke-width": "2",
160
- "stroke-linecap": "round",
161
- "stroke-linejoin": "round",
158
+ strokeWidth: "2",
159
+ strokeLinecap: "round",
160
+ strokeLinejoin: "round",
162
161
  className: "mr-2 h-4 w-4",
163
162
  children: [
164
163
  /* @__PURE__ */ e.jsx("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
@@ -170,7 +169,7 @@ const Ke = () => {
170
169
  ]
171
170
  }
172
171
  ),
173
- /* @__PURE__ */ e.jsx(Pe, { onRemove: () => D(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: [
172
+ /* @__PURE__ */ e.jsx(Se, { onRemove: () => t(r), name: r.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
174
173
  /* @__PURE__ */ e.jsxs(
175
174
  "svg",
176
175
  {
@@ -180,9 +179,9 @@ const Ke = () => {
180
179
  viewBox: "0 0 24 24",
181
180
  fill: "none",
182
181
  stroke: "currentColor",
183
- "stroke-width": "2",
184
- "stroke-linecap": "round",
185
- "stroke-linejoin": "round",
182
+ strokeWidth: "2",
183
+ strokeLinecap: "round",
184
+ strokeLinejoin: "round",
186
185
  className: "mr-2 h-4 w-4",
187
186
  children: [
188
187
  /* @__PURE__ */ e.jsx("path", { d: "M3 6h18" }),
@@ -198,11 +197,11 @@ const Ke = () => {
198
197
  },
199
198
  r.providerKey
200
199
  )) }),
201
- /* @__PURE__ */ e.jsx(_e, { onClose: () => j(null), provider: f })
200
+ /* @__PURE__ */ e.jsx(Ae, { onClose: () => c(null), provider: b })
202
201
  ] })
203
202
  ] });
204
- }, Ee = () => {
205
- const { t: s } = N(), o = {
203
+ }, Pe = () => {
204
+ const { t: s } = g(), o = {
206
205
  "ctrl + Z": "Undo",
207
206
  "ctrl + Y": "Redo",
208
207
  "ctrl + D": "Duplicate"
@@ -212,43 +211,43 @@ const Ke = () => {
212
211
  esc: "Deselect blocks",
213
212
  del: "Delete block"
214
213
  };
215
- return /* @__PURE__ */ e.jsxs(F, { children: [
216
- /* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
217
- /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx(g, { size: "sm", className: "w-10", variant: "outline", children: /* @__PURE__ */ e.jsx(J, {}) }) }),
218
- /* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
214
+ return /* @__PURE__ */ e.jsxs(M, { children: [
215
+ /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(je, { children: [
216
+ /* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsx(v, { size: "sm", className: "w-10", variant: "outline", children: /* @__PURE__ */ e.jsx(U, {}) }) }),
217
+ /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
219
218
  ] }) }),
220
- /* @__PURE__ */ e.jsxs(L, { className: "sm:max-w-[525px]", children: [
221
- /* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx(U, { children: s("Keyboard shortcuts") }) }),
219
+ /* @__PURE__ */ e.jsxs(H, { className: "sm:max-w-[525px]", children: [
220
+ /* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children: s("Keyboard shortcuts") }) }),
222
221
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
223
222
  /* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
224
- /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
223
+ /* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
225
224
  /* @__PURE__ */ e.jsx("div", { children: s(o[a]) })
226
225
  ] }, a)) }),
227
226
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(l).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
228
- /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
227
+ /* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
229
228
  /* @__PURE__ */ e.jsx("div", { children: s(l[a]) })
230
229
  ] }, a)) })
231
230
  ] }) })
232
231
  ] })
233
232
  ] });
234
- }, Be = b(() => import("./AddBlocks-WgpssWmQ.js")), P = b(() => import("./Outline-2OxsXs1-.js")), K = b(() => import("./ListTree-dvxHTXs4.js")), ze = b(() => import("./BrandingOptions-4961TxX2.js")), Ve = b(() => import("./index-IPJAbzzO.js").then((s) => s.cq));
235
- let M = null;
236
- const _s = () => {
237
- const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = H(Ne), [h, c] = p(l), [n, k] = p(null), { t: u } = N(), f = Se("arborist"), j = {
238
- "add-blocks": Be,
239
- [i]: f ? K : P,
240
- "branding-options": ze,
241
- images: Ve
233
+ }, Ke = w(() => import("./AddBlocks-l1JENNvq.js")), P = w(() => import("./ListTree-ZNEtds1d.js")), Ee = w(() => import("./BrandingOptions-udtH5yJs.js")), Be = w(() => import("./index-Gk6sASBd.js").then((s) => s.cq));
234
+ let L = null;
235
+ const Ts = () => {
236
+ const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = O(be), [h, d] = p(l), [n, k] = p(null), { t: u } = g(), b = {
237
+ "add-blocks": Ke,
238
+ [i]: P,
239
+ "branding-options": Ee,
240
+ images: Be
242
241
  };
243
- X(s, ({ name: t, panel: r }) => {
244
- j[t] = r;
242
+ Q(s, ({ name: t, panel: f }) => {
243
+ b[t] = f;
245
244
  });
246
- const d = (t) => {
247
- clearTimeout(M), l !== i && t === i ? M = setTimeout(() => a(i), 500) : c(t), a(t);
245
+ const c = (t) => {
246
+ clearTimeout(L), l !== i && t === i ? L = setTimeout(() => a(i), 500) : d(t), a(t);
248
247
  }, C = T("dataBindingSupport", !1);
249
248
  function D() {
250
249
  const t = setTimeout(() => {
251
- n && (d(i), clearTimeout(n));
250
+ n && (c(i), clearTimeout(n));
252
251
  }, 500);
253
252
  k(t);
254
253
  }
@@ -257,67 +256,67 @@ const _s = () => {
257
256
  "div",
258
257
  {
259
258
  onMouseEnter: D,
260
- onClick: () => d(i),
259
+ onClick: () => c(i),
261
260
  className: "fixed inset-0 z-[50] bg-black/20"
262
261
  }
263
262
  ) : null,
264
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: [
265
264
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
266
265
  /* @__PURE__ */ e.jsx(
267
- g,
266
+ v,
268
267
  {
269
268
  onClick: () => {
270
- d("add-blocks");
269
+ c("add-blocks");
271
270
  },
272
271
  size: "sm",
273
272
  variant: l === "add-blocks" ? "default" : "outline",
274
- children: /* @__PURE__ */ e.jsx(q, { className: "text-xl" })
273
+ children: /* @__PURE__ */ e.jsx(J, { className: "text-xl" })
275
274
  }
276
275
  ),
277
276
  /* @__PURE__ */ e.jsx(
278
- g,
277
+ v,
279
278
  {
280
- onClick: () => d(i),
279
+ onClick: () => c(i),
281
280
  size: "sm",
282
281
  variant: l === i ? "default" : "outline",
283
282
  children: /* @__PURE__ */ e.jsx(_, { className: "w-4" })
284
283
  }
285
284
  ),
286
285
  /* @__PURE__ */ e.jsx(
287
- g,
286
+ v,
288
287
  {
289
- onClick: () => d("branding-options"),
288
+ onClick: () => c("branding-options"),
290
289
  size: "sm",
291
290
  variant: l === "branding-options" ? "default" : "outline",
292
- children: /* @__PURE__ */ e.jsx(Y, { className: "w-4 max-w-[40px] text-xs" })
291
+ children: /* @__PURE__ */ e.jsx(q, { className: "w-4 max-w-[40px] text-xs" })
293
292
  }
294
293
  ),
295
- v.Children.toArray(
296
- s.map(({ name: t, icon: r }) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
297
- g,
294
+ j.Children.toArray(
295
+ s.map(({ name: t, icon: f }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
296
+ v,
298
297
  {
299
- onClick: () => d(t),
298
+ onClick: () => c(t),
300
299
  size: "sm",
301
300
  className: "w-10",
302
301
  variant: l === t ? "default" : "outline",
303
- children: /* @__PURE__ */ e.jsx(r, {})
302
+ children: /* @__PURE__ */ e.jsx(f, {})
304
303
  }
305
304
  ) }))
306
305
  )
307
306
  ] }),
308
307
  /* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
309
- /* @__PURE__ */ e.jsx(Ee, {}),
310
- v.Children.toArray(
311
- o.map((t) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
308
+ /* @__PURE__ */ e.jsx(Pe, {}),
309
+ j.Children.toArray(
310
+ o.map((t) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
312
311
  )
313
312
  ] })
314
313
  ] }),
315
- /* @__PURE__ */ e.jsx(
314
+ l !== i ? /* @__PURE__ */ e.jsx(
316
315
  "div",
317
316
  {
318
- className: `absolute left-14 z-[50] h-full w-fit min-w-[200px] border-r bg-background duration-500 ease-in-out ${l !== i ? "translate-x-0" : "-translate-x-full"}`,
317
+ className: "absolute left-14 z-[50] h-full w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
319
318
  children: /* @__PURE__ */ e.jsx(
320
- y,
319
+ N,
321
320
  {
322
321
  fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
323
322
  /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
@@ -327,29 +326,26 @@ const _s = () => {
327
326
  children: /* @__PURE__ */ e.jsx(
328
327
  "div",
329
328
  {
330
- className: Ae(
331
- "relative h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1",
332
- l === i ? "" : "z-[100]"
333
- ),
329
+ className: Te("relative z-[100] h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1"),
334
330
  onMouseEnter: () => {
335
331
  n && clearTimeout(n);
336
332
  },
337
- children: v.createElement(ee(j, l, () => /* @__PURE__ */ e.jsx("div", {})))
333
+ children: j.createElement(X(b, l, () => /* @__PURE__ */ e.jsx("div", {})))
338
334
  }
339
335
  )
340
336
  }
341
337
  )
342
338
  }
343
- ),
339
+ ) : null,
344
340
  /* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
345
- y,
341
+ N,
346
342
  {
347
343
  fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
348
344
  /* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
349
345
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
350
346
  /* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
351
347
  ] }),
352
- children: C ? /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
348
+ children: C ? /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
353
349
  /* @__PURE__ */ e.jsxs(I, { className: "mx-1 grid h-10 grid-cols-2", children: [
354
350
  /* @__PURE__ */ e.jsxs(A, { value: i, children: [
355
351
  /* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
@@ -357,13 +353,13 @@ const _s = () => {
357
353
  u("Outline")
358
354
  ] }),
359
355
  /* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
360
- /* @__PURE__ */ e.jsx(ye, { className: "mr-2 w-3" }),
356
+ /* @__PURE__ */ e.jsx(Ne, { className: "mr-2 w-3" }),
361
357
  u("Data")
362
358
  ] })
363
359
  ] }),
364
- /* @__PURE__ */ e.jsx(S, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: v.createElement(f ? K : P) }),
365
- /* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ke, {}) })
366
- ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
360
+ /* @__PURE__ */ e.jsx(S, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: j.createElement(P) }),
361
+ /* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(_e, {}) })
362
+ ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
367
363
  /* @__PURE__ */ e.jsx(I, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(A, { value: i, children: [
368
364
  /* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
369
365
  " ",
@@ -374,7 +370,7 @@ const _s = () => {
374
370
  {
375
371
  value: i,
376
372
  className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
377
- children: v.createElement(f ? K : P)
373
+ children: j.createElement(P)
378
374
  }
379
375
  )
380
376
  ] }) })
@@ -383,5 +379,5 @@ const _s = () => {
383
379
  ] });
384
380
  };
385
381
  export {
386
- _s as default
382
+ Ts as default
387
383
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("@radix-ui/react-icons"),i=require("react"),S=require("jotai"),u=require("lodash-es"),s=require("./index-h-hd6EvN.cjs"),R=require("lucide-react"),_=require("@chaibuilder/runtime"),f=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),D=require("./index-dgm-fd8U.cjs"),l=require("./STRINGS-gPz7CUOk.cjs"),K=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@react-hookz/web");require("./MODIFIERS-0g14w5RS.cjs");require("./Class-PoYusiA5.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");const C=({provider:t,onClose:a})=>{const{t:o}=f.useTranslation(),[n,h]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(c=>h(c))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:m=>m?"":a(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(D.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:n,shouldExpandNode:w.allExpanded,style:{...w.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function I({children:t,name:a,onRemove:o}){const{t:n}=f.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:n("remove_provider_confirmation").replace("{name}",a)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:n("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:n("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:o,className:"bg-red-600 hover:bg-red-700",children:n("remove")})]})]})]})}const P=()=>{const{t}=f.useTranslation(),a=i.useMemo(()=>_.getChaiDataProviders(),[]),[o,n]=s.usePageDataProviders(),[,h]=S.useAtom(s.builderSaveStateAtom),[m,c]=i.useState(u.filter(a,r=>u.map(o,"providerKey").includes(r.providerKey))),[b,E]=i.useState(""),[g,d]=i.useState(null),N=u.filter(a.map(r=>u.map(m,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),y=r=>{const p=u.find(a,{providerKey:r});c(j=>[...j,p]),n(j=>[...j,{providerKey:p.providerKey,args:{}}]),E(""),h("UNSAVED")},x=r=>{c(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),n(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),h("UNSAVED")},v=r=>d(r);return u.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:b,onValueChange:r=>y(r),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:t("choose")}),N.map(r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${m.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[t("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:m.map(r=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:r.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:r.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>v(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(I,{onRemove:()=>x(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(C,{onClose:()=>d(null),provider:g})]})]})},L=()=>{const{t}=f.useTranslation(),a={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx(s.Button,{size:"sm",className:"w-10",variant:"outline",children:e.jsxRuntimeExports.jsx(q.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(a).map(n=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(n)}),e.jsxRuntimeExports.jsx("div",{children:t(a[n])})]},n))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(n=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(n)}),e.jsxRuntimeExports.jsx("div",{children:t(o[n])})]},n))})]})})]})]})},O=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-zPPKkeKs.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-LAN7QmHQ.cjs"))),A=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-DkpqGARR.cjs"))),B=i.lazy(()=>Promise.resolve().then(()=>require("./index-h-hd6EvN.cjs")).then(t=>t.ImagesPanel));let k=null;const U=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),a=s.useBuilderProp("sideBarComponents.bottom",[]),[o,n]=S.useAtom(s.activePanelAtom),[h,m]=i.useState(o),[c,b]=i.useState(null),{t:E}=f.useTranslation(),g={"add-blocks":O,[l.OUTLINE_KEY]:T,"branding-options":A,images:B};u.each(t,({name:x,panel:v})=>{g[x]=v});const d=x=>{clearTimeout(k),o!==l.OUTLINE_KEY&&x===l.OUTLINE_KEY?k=setTimeout(()=>n(l.OUTLINE_KEY),500):m(x),n(x)},N=s.useBuilderProp("dataBindingSupport",!1);function y(){const x=setTimeout(()=>{c&&(d(l.OUTLINE_KEY),clearTimeout(c))},500);b(x)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[o!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:y,onClick:()=>d(l.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{d("add-blocks")},size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(q.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(l.OUTLINE_KEY),size:"sm",variant:o===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("branding-options"),size:"sm",variant:o==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(q.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:x,icon:v})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(x),size:"sm",className:"w-10",variant:o===x?"default":"outline",children:e.jsxRuntimeExports.jsx(v,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(L,{}),i.Children.toArray(a.map(x=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(x,{})})))]})]}),o!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-full w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:K.cn("relative z-[100] h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1"),onMouseEnter:()=>{c&&clearTimeout(c)},children:i.createElement(u.get(g,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}):null,e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:N?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(R.DatabaseIcon,{className:"mr-2 w-3"}),E("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(P,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)})]})})})})]})};exports.default=U;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),h=require("@radix-ui/react-icons"),t=require("./index-h-hd6EvN.cjs"),v=require("./index-ecnGWzh9.cjs"),i=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-0g14w5RS.cjs");require("./Class-PoYusiA5.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");const g=()=>t.useBuilderProp("languages",["en"]),H=()=>g().length===1?null:c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:c.jsxRuntimeExports.jsxs(t.Select,{children:[c.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"w-[150px] border-0",children:c.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:c.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[c.jsxRuntimeExports.jsx(h.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),c.jsxRuntimeExports.jsx(t.SelectContent,{children:c.jsxRuntimeExports.jsxs(t.SelectGroup,{children:[c.jsxRuntimeExports.jsx(t.SelectLabel,{children:"Fruits"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"apple",children:"Apple"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"banana",children:"Banana"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"blueberry",children:"Blueberry"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"grapes",children:"Grapes"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})});function V(l){return v.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(l)}const M=()=>{const{savePage:l,saveState:a}=t.useSavePage(),{t:s}=i.useTranslation(),e=t.useBuilderProp("hideSaveButton",!1),n=r.useMemo(()=>{switch(a){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[a]);if(e)return null;const o=c.jsxRuntimeExports.jsxs(t.Button,{disabled:a==="SAVING",onClick:z=>{z.preventDefault(),l()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${n}`,size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(V,{className:"text-lg"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:a==="SAVING"?"Saving...":s(a==="SAVED"?"Saved":"Unsaved")})]});return c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},u=function(){const a=t.useBuilderProp("previewComponent"),[,s]=t.usePreviewMode(),{t:e}=i.useTranslation();return a?c.jsxRuntimeExports.jsxs(t.Button,{onClick:n=>{n.preventDefault(),s(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(h.EyeOpenIcon,{className:"text-xs"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:e("Preview")})]}):null},d=()=>{const l=t.useBuilderProp("topBarComponents.left",[]),a=t.useBuilderProp("topBarComponents.center",[]),s=t.useBuilderProp("topBarComponents.right",[]),e=t.useBuilderProp("editable",!0);return c.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:r.Children.toArray(l.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))})}),c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:r.Children.toArray(a.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))}),c.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsxRuntimeExports.jsx(H,{}),c.jsxRuntimeExports.jsx(u,{}),c.jsxRuntimeExports.jsx(t.Separator,{orientation:"vertical"}),e?c.jsxRuntimeExports.jsx(M,{}):null,r.Children.toArray(s.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=d;