@chaibuilder/sdk 1.2.38 → 1.2.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddBlocks-Q--k4QYI.js +144 -0
- package/dist/AddBlocks-a20tIXfX.cjs +1 -0
- package/dist/{CanvasArea-MuuWWyW0.cjs → CanvasArea-QQn0aXpj.cjs} +5 -5
- package/dist/{CanvasArea-WJYJtUFt.js → CanvasArea-ahsds4rc.js} +183 -184
- package/dist/{ChaiBuilderEditor-PLQ8Sq34.cjs → ChaiBuilderEditor-hcoLrtq8.cjs} +49 -49
- package/dist/{ChaiBuilderEditor-vzyVasJe.js → ChaiBuilderEditor-wfEkvtJ0.js} +8163 -8050
- package/dist/{CurrentPage-j6xVMVFH.js → CurrentPage-f_5eIFbX.js} +9 -10
- package/dist/CurrentPage-zo2GKFUx.cjs +1 -0
- package/dist/{ListTree-1oWz6vwo.js → ListTree-3riQsfip.js} +1 -2
- package/dist/ListTree-FWHoDfbO.cjs +1 -0
- package/dist/PagesPanel-0Wi0ezNZ.cjs +1 -0
- package/dist/{PagesPanel-PKnqTla9.js → PagesPanel-3KIZEXOS.js} +4 -5
- package/dist/{ProjectPanel-hx21JHK8.js → ProjectPanel-0W6XTu0Y.js} +5 -6
- package/dist/ProjectPanel-fEYrObPB.cjs +1 -0
- package/dist/{Settings-3omes6Yj.js → Settings-ifUbqcam.js} +4 -5
- package/dist/Settings-kDwumlBm.cjs +1 -0
- package/dist/{SidePanels-vNc0pvVt.js → SidePanels-0P4IaIVn.js} +159 -140
- package/dist/SidePanels-JIuL8NLu.cjs +1 -0
- package/dist/{BrandingOptions-z7hXgff2.js → ThemeConfiguration-7Hef-UKR.js} +42 -41
- package/dist/ThemeConfiguration-CcUA1_9A.cjs +1 -0
- package/dist/{Topbar-c3HIPa_q.js → Topbar-0hOp8tE7.js} +3 -4
- package/dist/Topbar-Wte9Jbw7.cjs +1 -0
- package/dist/UILibrariesPanel-qgwFZYvn.js +145 -0
- package/dist/UILibrariesPanel-vXOD3qRz.cjs +1 -0
- package/dist/UnsplashImages-Cfq1lKeC.cjs +1 -0
- package/dist/{UnsplashImages-IQo081nF.js → UnsplashImages-qUDa1vAS.js} +3 -4
- package/dist/{UploadImages-BAy3wsRT.js → UploadImages-Xh-lPuZy.js} +3 -4
- package/dist/UploadImages-Zle03BGi.cjs +1 -0
- package/dist/add-page-modal-0jmyeD0x.cjs +1 -0
- package/dist/{add-page-modal-WWRdRyDM.js → add-page-modal-ued8fkUY.js} +16 -17
- package/dist/{confirm-alert-h4RiwjkJ.js → confirm-alert-4kucBgrO.js} +3 -4
- package/dist/{confirm-alert-LvvLsCWh.cjs → confirm-alert-rucvO9GC.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +22 -3
- package/dist/core.js +44 -45
- package/dist/delete-page-modal-Eym3aZzC.cjs +1 -0
- package/dist/{delete-page-modal-XymJxo7r.js → delete-page-modal-kxeOpfNd.js} +4 -5
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +22 -3
- package/dist/email.js +3 -4
- package/dist/{form-P0nEC3WH.js → form-2Veryr30.js} +1 -1
- package/dist/{form-I4uC5vkq.cjs → form-pdF1XhvW.cjs} +1 -1
- package/dist/{index-SP6aKHPH.js → index-OdzdznTv.js} +2 -2
- package/dist/{index-mVQVs_cP.cjs → index-SQ1sNajH.cjs} +1 -1
- package/dist/{page-viewer-OSlqdbEV.js → page-viewer-6qv40Sm2.js} +5 -6
- package/dist/page-viewer-qr3NscoT.cjs +1 -0
- package/dist/{project-general-setting-LXfl5i5Z.js → project-general-setting-GVzAsfrk.js} +5 -6
- package/dist/{project-general-setting-JR9L7fMQ.cjs → project-general-setting-fm1YfS_2.cjs} +1 -1
- package/dist/{project-seo-setting-cVDCPjBD.cjs → project-seo-setting-06jt9oDD.cjs} +1 -1
- package/dist/{project-seo-setting-lyzUUxe2.js → project-seo-setting-iPqsGKuc.js} +4 -5
- package/dist/{single-page-detail-GeG-SXWn.js → single-page-detail-GVtRl8Pt.js} +6 -7
- package/dist/single-page-detail-KQVwWJ-J.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +22 -3
- package/dist/studio.js +3 -4
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +138 -139
- package/dist/{useCanvasSettings-_EzUaA9P.js → useCanvasSettings-E5uIyvUR.js} +1 -1
- package/dist/{useCanvasSettings-bP_V0UR2.cjs → useCanvasSettings-yYU51FJ3.cjs} +1 -1
- package/package.json +2 -2
- package/dist/AddBlocks-G9pjsIyq.cjs +0 -1
- package/dist/AddBlocks-dljjAE5r.js +0 -210
- package/dist/BrandingOptions-N7iDaMgM.cjs +0 -1
- package/dist/CurrentPage-LaeYQ-Ke.cjs +0 -1
- package/dist/ListTree-_7e5p_e3.cjs +0 -1
- package/dist/PagesPanel-BsELxMie.cjs +0 -1
- package/dist/ProjectPanel-1aAFwguw.cjs +0 -1
- package/dist/Settings-tYjuuUgX.cjs +0 -1
- package/dist/SidePanels-7WG6SXw0.cjs +0 -1
- package/dist/Topbar-1zU6Ljsn.cjs +0 -1
- package/dist/UnsplashImages-zCQkmow-.cjs +0 -1
- package/dist/UploadImages-6K3GdM-b.cjs +0 -1
- package/dist/add-page-modal-8FJnOckX.cjs +0 -1
- package/dist/delete-page-modal-IRX0oKZJ.cjs +0 -1
- package/dist/page-viewer-fonOyiuT.cjs +0 -1
- package/dist/single-page-detail-LL8m0Va7.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { KeyboardIcon as
|
|
3
|
-
import
|
|
2
|
+
import { KeyboardIcon as J, PlusIcon as K, Component2Icon as Z } from "@radix-ui/react-icons";
|
|
3
|
+
import f, { useState as h, useEffect as W, useMemo as Y, memo as $, lazy as j, Suspense as N } from "react";
|
|
4
4
|
import { useAtom as O } from "jotai";
|
|
5
|
-
import { filter as
|
|
6
|
-
import { Z as
|
|
7
|
-
import { ListTreeIcon as
|
|
8
|
-
import { getChaiDataProviders as
|
|
5
|
+
import { filter as y, map as E, isNull as q, find as G, isEmpty as Q, each as X, get as ee } from "lodash-es";
|
|
6
|
+
import { Z as H, _ as U, $ as F, a0 as R, a1 as se, a2 as re, A as ae, a as le, b as ie, c as te, d as oe, e as ne, f as ce, g as de, a3 as me, a4 as xe, a5 as he, a6 as ue, a7 as pe, a8 as fe, a9 as je, aa as z, ab as ve, ac as ge, ad as be, ae as Ne, af as B, h as w, ag as ye, B as x, ah as L, ai as V, aj as I, ak as T, al as _ } from "./ChaiBuilderEditor-wfEkvtJ0.js";
|
|
7
|
+
import { ListTreeIcon as A, PaletteIcon as we, DatabaseIcon as ke } from "lucide-react";
|
|
8
|
+
import { getChaiDataProviders as Ce } from "@chaibuilder/runtime";
|
|
9
9
|
import { useTranslation as v } from "react-i18next";
|
|
10
|
-
import { J as De, a as
|
|
10
|
+
import { J as De, a as Te, d as _e } from "./index-e0c8PmRQ.js";
|
|
11
11
|
import { O as i } from "./STRINGS--j49GZJP.js";
|
|
12
|
-
import { c as
|
|
12
|
+
import { c as Ae } from "./Functions-7jnEwJyw.js";
|
|
13
13
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
14
|
import "clsx";
|
|
15
15
|
import "react-dom";
|
|
@@ -43,27 +43,26 @@ import "@radix-ui/react-context-menu";
|
|
|
43
43
|
import "react-icons-picker";
|
|
44
44
|
import "react-quill";
|
|
45
45
|
import "react-hotkeys-hook";
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const { t: l } = v(), [a, p] = h(null);
|
|
46
|
+
const Pe = ({ provider: r, onClose: t }) => {
|
|
47
|
+
const { t: a } = v(), [l, u] = h(null);
|
|
49
48
|
return W(() => {
|
|
50
|
-
|
|
51
|
-
}, [
|
|
49
|
+
r && (r.mockFn ? r.mockFn : r.dataFn)().then((c) => u(c));
|
|
50
|
+
}, [r]), r ? /* @__PURE__ */ e.jsx(H, { onOpenChange: (d) => d ? "" : t(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(U, { children: [
|
|
52
51
|
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
53
52
|
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
54
|
-
|
|
53
|
+
a("data_provider"),
|
|
55
54
|
": ",
|
|
56
|
-
|
|
55
|
+
r.name
|
|
57
56
|
] }),
|
|
58
|
-
/* @__PURE__ */ e.jsx(se, { children:
|
|
57
|
+
/* @__PURE__ */ e.jsx(se, { children: r.description })
|
|
59
58
|
] }),
|
|
60
59
|
/* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsx(
|
|
61
60
|
De,
|
|
62
61
|
{
|
|
63
|
-
data:
|
|
64
|
-
shouldExpandNode:
|
|
62
|
+
data: l,
|
|
63
|
+
shouldExpandNode: Te,
|
|
65
64
|
style: {
|
|
66
|
-
...
|
|
65
|
+
..._e,
|
|
67
66
|
container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
68
67
|
stringValue: "text-orange-600",
|
|
69
68
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -73,77 +72,77 @@ const Ae = ({ provider: s, onClose: o }) => {
|
|
|
73
72
|
] }) }) : null;
|
|
74
73
|
};
|
|
75
74
|
function Se({
|
|
76
|
-
children:
|
|
77
|
-
name:
|
|
78
|
-
onRemove:
|
|
75
|
+
children: r,
|
|
76
|
+
name: t,
|
|
77
|
+
onRemove: a
|
|
79
78
|
}) {
|
|
80
|
-
const { t:
|
|
79
|
+
const { t: l } = v();
|
|
81
80
|
return /* @__PURE__ */ e.jsxs(ae, { children: [
|
|
82
|
-
/* @__PURE__ */ e.jsx(le, { asChild: !0, children:
|
|
81
|
+
/* @__PURE__ */ e.jsx(le, { asChild: !0, children: r }),
|
|
83
82
|
/* @__PURE__ */ e.jsxs(ie, { children: [
|
|
84
83
|
/* @__PURE__ */ e.jsxs(te, { children: [
|
|
85
84
|
/* @__PURE__ */ e.jsx(
|
|
86
85
|
oe,
|
|
87
86
|
{
|
|
88
|
-
dangerouslySetInnerHTML: { __html:
|
|
87
|
+
dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", t) }
|
|
89
88
|
}
|
|
90
89
|
),
|
|
91
|
-
/* @__PURE__ */ e.jsx(ne, { children:
|
|
90
|
+
/* @__PURE__ */ e.jsx(ne, { children: l("remove_provider_warning") })
|
|
92
91
|
] }),
|
|
93
92
|
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
94
|
-
/* @__PURE__ */ e.jsx(de, { children:
|
|
95
|
-
/* @__PURE__ */ e.jsx(me, { onClick:
|
|
93
|
+
/* @__PURE__ */ e.jsx(de, { children: l("cancel") }),
|
|
94
|
+
/* @__PURE__ */ e.jsx(me, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
|
|
96
95
|
] })
|
|
97
96
|
] })
|
|
98
97
|
] });
|
|
99
98
|
}
|
|
100
|
-
const
|
|
101
|
-
const { t:
|
|
102
|
-
|
|
103
|
-
), [k,
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
),
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
return Q(
|
|
113
|
-
|
|
99
|
+
const Ke = () => {
|
|
100
|
+
const { t: r } = v(), t = Y(() => Ce(), []), [a, l] = xe(), [, u] = O(he), [d, c] = h(
|
|
101
|
+
y(t, (s) => E(a, "providerKey").includes(s.providerKey))
|
|
102
|
+
), [k, p] = h(""), [S, g] = h(null), b = y(
|
|
103
|
+
t.map((s) => E(d, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
104
|
+
(s) => !q(s)
|
|
105
|
+
), o = (s) => {
|
|
106
|
+
const n = G(t, { providerKey: s });
|
|
107
|
+
c((m) => [...m, n]), l((m) => [...m, { providerKey: n.providerKey, args: {} }]), p(""), u("UNSAVED");
|
|
108
|
+
}, C = (s) => {
|
|
109
|
+
c((n) => y(n, (m) => m.providerKey !== s.providerKey)), l((n) => y(n, (m) => m.providerKey !== s.providerKey)), u("UNSAVED");
|
|
110
|
+
}, D = (s) => g(s);
|
|
111
|
+
return Q(t) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
112
|
+
r("no_data_providers"),
|
|
114
113
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
115
|
-
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children:
|
|
114
|
+
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: r("learn_more") })
|
|
116
115
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
117
116
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
118
|
-
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children:
|
|
119
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
120
|
-
/* @__PURE__ */ e.jsx(
|
|
117
|
+
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: r("add_data_providers") }) }),
|
|
118
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ue, { value: k, onValueChange: (s) => o(s), children: [
|
|
119
|
+
/* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(fe, { placeholder: r("select_provider") }) }),
|
|
121
120
|
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
122
|
-
/* @__PURE__ */ e.jsx(
|
|
123
|
-
|
|
121
|
+
/* @__PURE__ */ e.jsx(z, { value: "", children: r("choose") }),
|
|
122
|
+
b.map((s) => /* @__PURE__ */ e.jsx(z, { value: s.value, children: s.label }, s.value))
|
|
124
123
|
] })
|
|
125
124
|
] }) }),
|
|
126
125
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
127
126
|
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${d.length ? "block" : "hidden"}`, children: [
|
|
128
127
|
/* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
|
|
129
|
-
|
|
128
|
+
r("page_data_providers"),
|
|
130
129
|
":"
|
|
131
130
|
] }),
|
|
132
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: d.map((
|
|
131
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: d.map((s) => /* @__PURE__ */ e.jsxs(
|
|
133
132
|
"div",
|
|
134
133
|
{
|
|
135
134
|
className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
136
135
|
"data-v0-t": "card",
|
|
137
136
|
children: [
|
|
138
137
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-1.5 px-4 pt-4", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
139
|
-
/* @__PURE__ */ e.jsx("h3", { className: "font-medium leading-4", children:
|
|
140
|
-
/* @__PURE__ */ e.jsx("p", { className: "pt-1 text-xs text-gray-400", children:
|
|
138
|
+
/* @__PURE__ */ e.jsx("h3", { className: "font-medium leading-4", children: s.name }),
|
|
139
|
+
/* @__PURE__ */ e.jsx("p", { className: "pt-1 text-xs text-gray-400", children: s.description })
|
|
141
140
|
] }) }) }),
|
|
142
141
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-2 py-2", children: [
|
|
143
142
|
/* @__PURE__ */ e.jsxs(
|
|
144
143
|
"button",
|
|
145
144
|
{
|
|
146
|
-
onClick: () =>
|
|
145
|
+
onClick: () => D(s),
|
|
147
146
|
className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
148
147
|
children: [
|
|
149
148
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -165,11 +164,11 @@ const Pe = () => {
|
|
|
165
164
|
]
|
|
166
165
|
}
|
|
167
166
|
),
|
|
168
|
-
|
|
167
|
+
r("view_data")
|
|
169
168
|
]
|
|
170
169
|
}
|
|
171
170
|
),
|
|
172
|
-
/* @__PURE__ */ e.jsx(Se, { onRemove: () =>
|
|
171
|
+
/* @__PURE__ */ e.jsx(Se, { onRemove: () => C(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
|
|
173
172
|
/* @__PURE__ */ e.jsxs(
|
|
174
173
|
"svg",
|
|
175
174
|
{
|
|
@@ -190,133 +189,151 @@ const Pe = () => {
|
|
|
190
189
|
]
|
|
191
190
|
}
|
|
192
191
|
),
|
|
193
|
-
|
|
192
|
+
r("remove")
|
|
194
193
|
] }) })
|
|
195
194
|
] })
|
|
196
195
|
]
|
|
197
196
|
},
|
|
198
|
-
|
|
197
|
+
s.providerKey
|
|
199
198
|
)) }),
|
|
200
|
-
/* @__PURE__ */ e.jsx(
|
|
199
|
+
/* @__PURE__ */ e.jsx(Pe, { onClose: () => g(null), provider: S })
|
|
201
200
|
] })
|
|
202
201
|
] });
|
|
203
|
-
},
|
|
204
|
-
const { t:
|
|
202
|
+
}, Ee = $(() => {
|
|
203
|
+
const { t: r } = v(), t = {
|
|
205
204
|
"ctrl + Z": "Undo",
|
|
206
205
|
"ctrl + Y": "Redo",
|
|
207
206
|
"ctrl + D": "Duplicate"
|
|
208
|
-
},
|
|
207
|
+
}, a = {
|
|
209
208
|
// "ctrl + /": "Rename block",
|
|
210
209
|
"ctrl + S": "Save page",
|
|
211
210
|
esc: "Deselect blocks",
|
|
212
211
|
del: "Delete block"
|
|
213
212
|
};
|
|
214
|
-
return /* @__PURE__ */ e.jsxs(
|
|
213
|
+
return /* @__PURE__ */ e.jsxs(H, { children: [
|
|
215
214
|
/* @__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(
|
|
217
|
-
/* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsx("p", { children:
|
|
215
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(J, {}) }) }),
|
|
216
|
+
/* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsx("p", { children: r("Keyboard shortcuts") }) })
|
|
218
217
|
] }) }),
|
|
219
|
-
/* @__PURE__ */ e.jsxs(
|
|
220
|
-
/* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children:
|
|
218
|
+
/* @__PURE__ */ e.jsxs(U, { className: "sm:max-w-[525px]", children: [
|
|
219
|
+
/* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children: r("Keyboard shortcuts") }) }),
|
|
221
220
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
|
|
222
|
-
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(
|
|
223
|
-
/* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children:
|
|
224
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
225
|
-
] },
|
|
226
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(
|
|
227
|
-
/* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children:
|
|
228
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
229
|
-
] },
|
|
221
|
+
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(t).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
222
|
+
/* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: r(l) }),
|
|
223
|
+
/* @__PURE__ */ e.jsx("div", { children: r(t[l]) })
|
|
224
|
+
] }, l)) }),
|
|
225
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(a).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
226
|
+
/* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: r(l) }),
|
|
227
|
+
/* @__PURE__ */ e.jsx("div", { children: r(a[l]) })
|
|
228
|
+
] }, l)) })
|
|
230
229
|
] }) })
|
|
231
230
|
] })
|
|
232
231
|
] });
|
|
233
|
-
}),
|
|
234
|
-
let
|
|
235
|
-
const
|
|
236
|
-
const
|
|
237
|
-
"add-blocks":
|
|
232
|
+
}), ze = j(() => import("./AddBlocks-Q--k4QYI.js")), P = j(() => import("./ListTree-3riQsfip.js")), Be = j(() => import("./ThemeConfiguration-7Hef-UKR.js")), Le = j(() => import("./ChaiBuilderEditor-wfEkvtJ0.js").then((r) => r.co)), Ve = j(() => import("./UILibrariesPanel-qgwFZYvn.js"));
|
|
233
|
+
let M = null;
|
|
234
|
+
const As = () => {
|
|
235
|
+
const r = w("sideBarComponents.top", []), t = w("sideBarComponents.bottom", []), [a, l] = O(ye), [u, d] = h(a), [c, k] = h(null), { t: p } = v(), g = w("uiLibraries", []).length > 0, b = {
|
|
236
|
+
"add-blocks": ze,
|
|
238
237
|
[i]: P,
|
|
239
|
-
"
|
|
240
|
-
images:
|
|
238
|
+
"theme-configuration": Be,
|
|
239
|
+
images: Le,
|
|
240
|
+
"ui-libraries": Ve
|
|
241
241
|
};
|
|
242
|
-
X(
|
|
243
|
-
|
|
242
|
+
X(r, ({ name: s, panel: n }) => {
|
|
243
|
+
b[s] = n;
|
|
244
244
|
});
|
|
245
|
-
const
|
|
246
|
-
clearTimeout(
|
|
247
|
-
},
|
|
248
|
-
function
|
|
249
|
-
const
|
|
250
|
-
|
|
245
|
+
const o = (s) => {
|
|
246
|
+
clearTimeout(M), a !== i && s === i ? M = setTimeout(() => l(i), 500) : d(s), l(s);
|
|
247
|
+
}, C = w("dataBindingSupport", !1);
|
|
248
|
+
function D() {
|
|
249
|
+
const s = setTimeout(() => {
|
|
250
|
+
c && (o(i), clearTimeout(c));
|
|
251
251
|
}, 500);
|
|
252
|
-
k(
|
|
252
|
+
k(s);
|
|
253
253
|
}
|
|
254
254
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
255
|
-
|
|
255
|
+
a !== i ? /* @__PURE__ */ e.jsx(
|
|
256
256
|
"div",
|
|
257
257
|
{
|
|
258
|
-
onMouseEnter:
|
|
259
|
-
onClick: () =>
|
|
258
|
+
onMouseEnter: D,
|
|
259
|
+
onClick: () => o(i),
|
|
260
260
|
className: "fixed inset-0 z-[50] bg-black/20"
|
|
261
261
|
}
|
|
262
262
|
) : null,
|
|
263
263
|
/* @__PURE__ */ e.jsxs("div", { className: "z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2", children: [
|
|
264
264
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
|
|
265
|
-
/* @__PURE__ */ e.
|
|
266
|
-
|
|
265
|
+
g ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 rounded-md bg-gray-200 p-1", children: [
|
|
266
|
+
/* @__PURE__ */ e.jsx(
|
|
267
|
+
x,
|
|
268
|
+
{
|
|
269
|
+
onClick: () => o("add-blocks"),
|
|
270
|
+
size: "sm",
|
|
271
|
+
variant: a === "add-blocks" ? "default" : "outline",
|
|
272
|
+
children: /* @__PURE__ */ e.jsx(K, { className: "text-xl" })
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ e.jsx(
|
|
276
|
+
x,
|
|
277
|
+
{
|
|
278
|
+
onClick: () => o("ui-libraries"),
|
|
279
|
+
size: "sm",
|
|
280
|
+
variant: a === "ui-libraries" ? "default" : "outline",
|
|
281
|
+
children: /* @__PURE__ */ e.jsx(Z, { className: "text-xl" })
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
] }) : /* @__PURE__ */ e.jsx(
|
|
285
|
+
x,
|
|
267
286
|
{
|
|
268
|
-
onClick: () =>
|
|
269
|
-
c("add-blocks");
|
|
270
|
-
},
|
|
287
|
+
onClick: () => o("add-blocks"),
|
|
271
288
|
size: "sm",
|
|
272
|
-
variant:
|
|
273
|
-
children: /* @__PURE__ */ e.jsx(
|
|
289
|
+
variant: a === "add-blocks" ? "default" : "outline",
|
|
290
|
+
children: /* @__PURE__ */ e.jsx(K, { className: "text-xl" })
|
|
274
291
|
}
|
|
275
292
|
),
|
|
276
293
|
/* @__PURE__ */ e.jsx(
|
|
277
|
-
|
|
294
|
+
x,
|
|
278
295
|
{
|
|
279
|
-
onClick: () =>
|
|
296
|
+
onClick: () => o(i),
|
|
280
297
|
size: "sm",
|
|
281
|
-
variant:
|
|
282
|
-
children: /* @__PURE__ */ e.jsx(
|
|
298
|
+
variant: a === i ? "default" : "outline",
|
|
299
|
+
children: /* @__PURE__ */ e.jsx(A, { className: "w-4" })
|
|
283
300
|
}
|
|
284
301
|
),
|
|
285
302
|
/* @__PURE__ */ e.jsx(
|
|
286
|
-
|
|
303
|
+
x,
|
|
287
304
|
{
|
|
288
|
-
onClick: () =>
|
|
305
|
+
onClick: () => o("theme-configuration"),
|
|
289
306
|
size: "sm",
|
|
290
|
-
variant:
|
|
291
|
-
children: /* @__PURE__ */ e.jsx(
|
|
307
|
+
variant: a === "theme-configuration" ? "default" : "outline",
|
|
308
|
+
children: /* @__PURE__ */ e.jsx(we, { className: "w-4 max-w-[40px] text-xs" })
|
|
292
309
|
}
|
|
293
310
|
),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
311
|
+
f.Children.toArray(
|
|
312
|
+
r.map(({ name: s, icon: n }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(L, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
313
|
+
x,
|
|
297
314
|
{
|
|
298
|
-
onClick: () =>
|
|
315
|
+
onClick: () => o(s),
|
|
299
316
|
size: "sm",
|
|
300
317
|
className: "w-10",
|
|
301
|
-
variant:
|
|
302
|
-
children: /* @__PURE__ */ e.jsx(
|
|
318
|
+
variant: a === s ? "default" : "outline",
|
|
319
|
+
children: /* @__PURE__ */ e.jsx(n, {})
|
|
303
320
|
}
|
|
304
321
|
) }))
|
|
305
322
|
)
|
|
306
323
|
] }),
|
|
307
324
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
308
|
-
/* @__PURE__ */ e.jsx(
|
|
309
|
-
|
|
310
|
-
|
|
325
|
+
/* @__PURE__ */ e.jsx(Ee, {}),
|
|
326
|
+
f.Children.toArray(
|
|
327
|
+
t.map((s) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(L, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
|
|
311
328
|
)
|
|
312
329
|
] })
|
|
313
330
|
] }),
|
|
314
|
-
|
|
331
|
+
a !== i ? /* @__PURE__ */ e.jsx(
|
|
315
332
|
"div",
|
|
316
333
|
{
|
|
317
|
-
className: "absolute left-14 z-[50] h-
|
|
334
|
+
className: "absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
|
|
318
335
|
children: /* @__PURE__ */ e.jsx(
|
|
319
|
-
|
|
336
|
+
N,
|
|
320
337
|
{
|
|
321
338
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
|
|
322
339
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -326,11 +343,13 @@ const _s = () => {
|
|
|
326
343
|
children: /* @__PURE__ */ e.jsx(
|
|
327
344
|
"div",
|
|
328
345
|
{
|
|
329
|
-
className:
|
|
346
|
+
className: Ae(
|
|
347
|
+
"relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"
|
|
348
|
+
),
|
|
330
349
|
onMouseEnter: () => {
|
|
331
|
-
|
|
350
|
+
c && clearTimeout(c);
|
|
332
351
|
},
|
|
333
|
-
children:
|
|
352
|
+
children: f.createElement(ee(b, a, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
334
353
|
}
|
|
335
354
|
)
|
|
336
355
|
}
|
|
@@ -338,39 +357,39 @@ const _s = () => {
|
|
|
338
357
|
}
|
|
339
358
|
) : null,
|
|
340
359
|
/* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
|
|
341
|
-
|
|
360
|
+
N,
|
|
342
361
|
{
|
|
343
362
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
|
|
344
363
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
345
364
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
346
365
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
347
366
|
] }),
|
|
348
|
-
children:
|
|
367
|
+
children: C ? /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
349
368
|
/* @__PURE__ */ e.jsxs(I, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
350
|
-
/* @__PURE__ */ e.jsxs(
|
|
351
|
-
/* @__PURE__ */ e.jsx(
|
|
369
|
+
/* @__PURE__ */ e.jsxs(T, { value: i, children: [
|
|
370
|
+
/* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
|
|
352
371
|
" ",
|
|
353
|
-
|
|
372
|
+
p("Outline")
|
|
354
373
|
] }),
|
|
355
|
-
/* @__PURE__ */ e.jsxs(
|
|
356
|
-
/* @__PURE__ */ e.jsx(
|
|
357
|
-
|
|
374
|
+
/* @__PURE__ */ e.jsxs(T, { value: "data-provider", children: [
|
|
375
|
+
/* @__PURE__ */ e.jsx(ke, { className: "mr-2 w-3" }),
|
|
376
|
+
p("Data")
|
|
358
377
|
] })
|
|
359
378
|
] }),
|
|
360
|
-
/* @__PURE__ */ e.jsx(
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
362
|
-
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
363
|
-
/* @__PURE__ */ e.jsx(I, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(
|
|
364
|
-
/* @__PURE__ */ e.jsx(
|
|
379
|
+
/* @__PURE__ */ e.jsx(_, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(P) }),
|
|
380
|
+
/* @__PURE__ */ e.jsx(_, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ke, {}) })
|
|
381
|
+
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
382
|
+
/* @__PURE__ */ e.jsx(I, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(T, { value: i, children: [
|
|
383
|
+
/* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
|
|
365
384
|
" ",
|
|
366
|
-
|
|
385
|
+
p("Outline")
|
|
367
386
|
] }) }),
|
|
368
387
|
/* @__PURE__ */ e.jsx(
|
|
369
|
-
|
|
388
|
+
_,
|
|
370
389
|
{
|
|
371
390
|
value: i,
|
|
372
391
|
className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
373
|
-
children:
|
|
392
|
+
children: f.createElement(P)
|
|
374
393
|
}
|
|
375
394
|
)
|
|
376
395
|
] }) })
|
|
@@ -379,5 +398,5 @@ const _s = () => {
|
|
|
379
398
|
] });
|
|
380
399
|
};
|
|
381
400
|
export {
|
|
382
|
-
|
|
401
|
+
As as default
|
|
383
402
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("@radix-ui/react-icons"),i=require("react"),C=require("jotai"),a=require("lodash-es"),s=require("./ChaiBuilderEditor-hcoLrtq8.cjs"),E=require("lucide-react"),S=require("@chaibuilder/runtime"),v=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),l=require("./STRINGS-gPz7CUOk.cjs"),_=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");const D=({provider:r,onClose:x})=>{const{t:n}=v.useTranslation(),[o,p]=i.useState(null);return i.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(d=>p(d))},[r]),r?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:m=>m?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[n("data_provider"),": ",r.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(s.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:o,shouldExpandNode:w.allExpanded,style:{...w.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function I({children:r,name:x,onRemove:n}){const{t:o}=v.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:r}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:o("remove_provider_confirmation").replace("{name}",x)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:o("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:o("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:o("remove")})]})]})]})}const K=()=>{const{t:r}=v.useTranslation(),x=i.useMemo(()=>S.getChaiDataProviders(),[]),[n,o]=s.usePageDataProviders(),[,p]=C.useAtom(s.builderSaveStateAtom),[m,d]=i.useState(a.filter(x,t=>a.map(n,"providerKey").includes(t.providerKey))),[b,h]=i.useState(""),[q,f]=i.useState(null),R=a.filter(x.map(t=>a.map(m,"providerKey").includes(t.providerKey)?null:{value:t.providerKey,label:t.name}),t=>!a.isNull(t)),u=t=>{const c=a.find(x,{providerKey:t});d(j=>[...j,c]),o(j=>[...j,{providerKey:c.providerKey,args:{}}]),h(""),p("UNSAVED")},N=t=>{d(c=>a.filter(c,j=>j.providerKey!==t.providerKey)),o(c=>a.filter(c,j=>j.providerKey!==t.providerKey)),p("UNSAVED")},y=t=>f(t);return a.isEmpty(x)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[r("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:r("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:r("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:b,onValueChange:t=>u(t),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:r("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:r("choose")}),R.map(t=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:t.value,children:t.label},t.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${m.length?"block":"hidden"}`,children:[e.jsxRuntimeExports.jsxs("p",{className:"flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500",children:[r("page_data_providers"),":"]}),e.jsxRuntimeExports.jsx("div",{className:"space-y-2",children:m.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"w-full rounded-lg border bg-card text-card-foreground shadow-sm","data-v0-t":"card",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-1.5 px-4 pt-4",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("h3",{className:"font-medium leading-4",children:t.name}),e.jsxRuntimeExports.jsx("p",{className:"pt-1 text-xs text-gray-400",children:t.description})]})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between p-2 py-2",children:[e.jsxRuntimeExports.jsxs("button",{onClick:()=>y(t),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),r("view_data")]}),e.jsxRuntimeExports.jsx(I,{onRemove:()=>N(t),name:t.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),r("remove")]})})]})]},t.providerKey))}),e.jsxRuntimeExports.jsx(D,{onClose:()=>f(null),provider:q})]})]})},P=i.memo(()=>{const{t:r}=v.useTranslation(),x={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},n={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx("div",{className:"flex w-10 items-center justify-center",children:e.jsxRuntimeExports.jsx(g.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:r("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:r("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(x).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:r(o)}),e.jsxRuntimeExports.jsx("div",{children:r(x[o])})]},o))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(n).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:r(o)}),e.jsxRuntimeExports.jsx("div",{children:r(n[o])})]},o))})]})})]})]})}),L=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-a20tIXfX.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-FWHoDfbO.cjs"))),O=i.lazy(()=>Promise.resolve().then(()=>require("./ThemeConfiguration-CcUA1_9A.cjs"))),A=i.lazy(()=>Promise.resolve().then(()=>require("./ChaiBuilderEditor-hcoLrtq8.cjs")).then(r=>r.ImagesPanel)),B=i.lazy(()=>Promise.resolve().then(()=>require("./UILibrariesPanel-vXOD3qRz.cjs")));let k=null;const U=()=>{const r=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[n,o]=C.useAtom(s.activePanelAtom),[p,m]=i.useState(n),[d,b]=i.useState(null),{t:h}=v.useTranslation(),f=s.useBuilderProp("uiLibraries",[]).length>0,R={"add-blocks":L,[l.OUTLINE_KEY]:T,"theme-configuration":O,images:A,"ui-libraries":B};a.each(r,({name:t,panel:c})=>{R[t]=c});const u=t=>{clearTimeout(k),n!==l.OUTLINE_KEY&&t===l.OUTLINE_KEY?k=setTimeout(()=>o(l.OUTLINE_KEY),500):m(t),o(t)},N=s.useBuilderProp("dataBindingSupport",!1);function y(){const t=setTimeout(()=>{d&&(u(l.OUTLINE_KEY),clearTimeout(d))},500);b(t)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:y,onClick:()=>u(l.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[f?e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 rounded-md bg-gray-200 p-1",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("add-blocks"),size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("ui-libraries"),size:"sm",variant:n==="ui-libraries"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.Component2Icon,{className:"text-xl"})})]}):e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("add-blocks"),size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u(l.OUTLINE_KEY),size:"sm",variant:n===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u("theme-configuration"),size:"sm",variant:n==="theme-configuration"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.PaletteIcon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(r.map(({name:t,icon:c})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>u(t),size:"sm",className:"w-10",variant:n===t?"default":"outline",children:e.jsxRuntimeExports.jsx(c,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(P,{}),i.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]}),n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:_.cn("relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"),onMouseEnter:()=>{d&&clearTimeout(d)},children:i.createElement(a.get(R,n,()=>e.jsxRuntimeExports.jsx("div",{})))})})}):null,e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:N?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"mr-2 w-3"}),h("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(K,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(T)})]})})})})]})};exports.default=U;
|