@chaibuilder/sdk 1.2.63 → 1.2.65
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/CanvasArea-fSdH_RiN.cjs +1 -0
- package/dist/{CanvasArea-DvfLxy0w.js → CanvasArea-ut5yknzX.js} +58 -54
- package/dist/{CodeEditor-QPwyZNgA.js → CodeEditor-Qff4q7sx.js} +1 -1
- package/dist/{CurrentPage-rOUX01kk.js → CurrentPage-jHSVy3hq.js} +38 -26
- package/dist/CurrentPage-p_AM4lrF.cjs +1 -0
- package/dist/{PagesPanel-6P4VkMP-.js → PagesPanel-U3InJ9Db.js} +20 -8
- package/dist/PagesPanel-wqDb4D-x.cjs +1 -0
- package/dist/{ProjectPanel-Cn3teDRW.js → ProjectPanel-XODJTO4J.js} +36 -24
- package/dist/ProjectPanel-fWESzHr6.cjs +1 -0
- package/dist/{SidePanels-_Im6sF4f.js → SidePanels-ijaUKSek.js} +84 -70
- package/dist/SidePanels-lrMQqc0h.cjs +1 -0
- package/dist/Topbar-RrCDxd0i.cjs +1 -0
- package/dist/{Topbar-SuY-S0im.js → Topbar-vHlnfxPs.js} +45 -30
- package/dist/UILibrariesPanel-7btHgBD0.cjs +1 -0
- package/dist/{UILibrariesPanel-RI9mo293.js → UILibrariesPanel-NVUMUPUj.js} +83 -63
- package/dist/{UnsplashImages-dasLGrBn.js → UnsplashImages-UkHihhA5.js} +16 -16
- package/dist/{UploadImages-Gh2AQpk1.js → UploadImages-HtuJZJlo.js} +7 -7
- package/dist/add-page-modal-RwIj1FxH.cjs +1 -0
- package/dist/{add-page-modal-zCiyvKEa.js → add-page-modal-TOfMfmPA.js} +32 -23
- package/dist/{confirm-alert-9XYi0a4k.js → confirm-alert-eIp2cAkc.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +10 -7
- package/dist/core.js +74 -59
- package/dist/{delete-page-modal-pzagU_6y.js → delete-page-modal-4bxjpVBD.js} +33 -21
- package/dist/delete-page-modal-qYDZmpgT.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.js +20 -5
- package/dist/{form-EjiQiiEY.js → form-NAzFjGs0.js} +9 -9
- package/dist/html-to-json-NqRjgFqp.cjs +1 -0
- package/dist/html-to-json-l_mw5y-e.js +243 -0
- package/dist/{index-DzAuS11k.cjs → index--k2M8kzI.cjs} +1 -1
- package/dist/{index-BbW1Uw_k.cjs → index-5XyNUAjc.cjs} +81 -22
- package/dist/{index-bscJUvUx.js → index-C7mB4XFm.js} +117 -117
- package/dist/{index-qSbpzIA4.js → index-YZhtVcj_.js} +4 -4
- package/dist/{index-EEcKvBh3.js → index-lFgDm1oa.js} +48587 -45055
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +22 -22
- package/dist/page-viewer-4wrnWnK0.js +124 -0
- package/dist/page-viewer-ra0GLx1p.cjs +1 -0
- package/dist/{project-general-setting-5B7s5swF.js → project-general-setting-IwZUkYF3.js} +18 -9
- package/dist/project-general-setting-lFjTUhHD.cjs +1 -0
- package/dist/{project-seo-setting-aAGnwBrw.js → project-seo-setting-e1fTqVsd.js} +2 -2
- package/dist/{single-page-detail-Yr0EbBJJ.js → single-page-detail-ZNWFKqLW.js} +69 -60
- package/dist/single-page-detail-g55Anu7R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +18 -6
- package/dist/style.css +2 -2
- package/dist/ui.js +67 -67
- package/package.json +1 -1
- package/dist/AddBlocks-4wpxOF2K.cjs +0 -1
- package/dist/AddBlocks-ChNxwRrx.js +0 -142
- package/dist/CanvasArea-hGLbDJlM.cjs +0 -1
- package/dist/CurrentPage-fMCaBGwl.cjs +0 -1
- package/dist/PagesPanel-ZCZjs7Bi.cjs +0 -1
- package/dist/ProjectPanel-XSVWRr6v.cjs +0 -1
- package/dist/Settings-Amh8Mtm7.cjs +0 -1
- package/dist/Settings-dbB2VPAj.js +0 -2378
- package/dist/SidePanels-5adH7U3T.cjs +0 -1
- package/dist/StaticCanvas-fDhBK35X.cjs +0 -60
- package/dist/StaticCanvas-goU42OMU.js +0 -749
- package/dist/ThemeConfigPanel-N6l317II.cjs +0 -1
- package/dist/ThemeConfigPanel-aEN4tTYi.js +0 -191
- package/dist/Topbar-ag6qdgbe.cjs +0 -1
- package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
- package/dist/add-page-modal-80cVOM7i.cjs +0 -1
- package/dist/atoms-KQpaDRnF.cjs +0 -1
- package/dist/atoms-Oomqut88.js +0 -6
- package/dist/delete-page-modal-foPRP--l.cjs +0 -1
- package/dist/html-to-json-_01DXd-a.js +0 -192
- package/dist/html-to-json-ndxaXRT8.cjs +0 -1
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/page-viewer-XFTCHu_2.cjs +0 -1
- package/dist/page-viewer-Z1wXyzzc.js +0 -112
- package/dist/plugin-2hf9pCRy.cjs +0 -1
- package/dist/plugin-wDnsBVPp.js +0 -54
- package/dist/project-general-setting-HV3X_wHI.cjs +0 -1
- package/dist/single-page-detail-6C1WP3s5.cjs +0 -1
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { KeyboardIcon as R, PlusIcon as S, Component2Icon as J } from "@radix-ui/react-icons";
|
|
3
|
-
import f, { useState as
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { filter as N, map as
|
|
6
|
-
import {
|
|
7
|
-
import { ListTreeIcon as
|
|
3
|
+
import f, { useState as p, useEffect as Y, useMemo as Z, memo as W, lazy as v, Suspense as j } from "react";
|
|
4
|
+
import { useAtom as O } from "jotai";
|
|
5
|
+
import { filter as N, map as B, isNull as X, find as $, isEmpty as q, values as G, each as Q, get as ee } from "lodash-es";
|
|
6
|
+
import { ah as M, aj as H, ad as U, ae as F, af as se, A as re, a as ie, b as te, c as le, d as ae, e as oe, f as ne, g as ce, b8 as de, a0 as me, ba as xe, bw as pe, bx as he, by as ue, bz as fe, bA as K, ai as je, T as ve, v as ge, w as be, bB as E, h as w, aO as ye, B as x, a3 as z, aX as Ne, aY as we, aZ as L, bC as I } from "./index-C7mB4XFm.js";
|
|
7
|
+
import { ListTreeIcon as P, PaletteIcon as ke, DatabaseIcon as Ce } from "lucide-react";
|
|
8
8
|
import { getChaiDataProviders as De, useChaiBlocks as Te } from "@chaibuilder/runtime";
|
|
9
|
-
import { useTranslation as
|
|
10
|
-
import { J as
|
|
11
|
-
import { E as Se } from "./index-EEcKvBh3.js";
|
|
9
|
+
import { useTranslation as g } from "react-i18next";
|
|
10
|
+
import { E as Ae, J as Pe, a as _e, d as Se } from "./index-lFgDm1oa.js";
|
|
12
11
|
import { O as o } from "./MODIFIERS-fd5XOmum.js";
|
|
13
|
-
import { c as
|
|
12
|
+
import { c as Be } from "./Functions-7jnEwJyw.js";
|
|
14
13
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
14
|
import "@radix-ui/react-toggle";
|
|
16
15
|
import "class-variance-authority";
|
|
@@ -43,14 +42,29 @@ import "tree-model";
|
|
|
43
42
|
import "i18next";
|
|
44
43
|
import "react-arborist";
|
|
45
44
|
import "./index-VBXQixVm.js";
|
|
45
|
+
import "prop-types";
|
|
46
|
+
import "react-hotkeys-hook";
|
|
47
|
+
import "@floating-ui/dom";
|
|
46
48
|
import "@floating-ui/react-dom";
|
|
47
49
|
import "flagged";
|
|
48
|
-
import "
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
import "@tailwindcss/typography";
|
|
51
|
+
import "@tailwindcss/forms";
|
|
52
|
+
import "@tailwindcss/aspect-ratio";
|
|
53
|
+
import "tailwindcss-palette-generator";
|
|
54
|
+
import "./html-to-json-l_mw5y-e.js";
|
|
55
|
+
import "himalaya";
|
|
56
|
+
import "lodash";
|
|
57
|
+
import "react-wrap-balancer";
|
|
58
|
+
import "@rjsf/core";
|
|
59
|
+
import "@rjsf/validator-ajv8";
|
|
60
|
+
import "react-autosuggest";
|
|
61
|
+
import "fuse.js";
|
|
62
|
+
import "./controls-yjgoZzB6.js";
|
|
63
|
+
const Ke = ({ provider: s, onClose: a }) => {
|
|
64
|
+
const { t } = g(), [l, h] = p(null);
|
|
65
|
+
return Y(() => {
|
|
66
|
+
s && (s.mockFn ? s.mockFn : s.dataFn)().then((c) => h(c));
|
|
67
|
+
}, [s]), s ? /* @__PURE__ */ e.jsx(M, { onOpenChange: (d) => d ? "" : a(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(H, { children: [
|
|
54
68
|
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
55
69
|
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
56
70
|
t("data_provider"),
|
|
@@ -59,13 +73,13 @@ const Be = ({ provider: s, onClose: a }) => {
|
|
|
59
73
|
] }),
|
|
60
74
|
/* @__PURE__ */ e.jsx(se, { children: s.description })
|
|
61
75
|
] }),
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
|
|
76
|
+
/* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsx(
|
|
77
|
+
Pe,
|
|
64
78
|
{
|
|
65
79
|
data: l,
|
|
66
|
-
shouldExpandNode:
|
|
80
|
+
shouldExpandNode: _e,
|
|
67
81
|
style: {
|
|
68
|
-
...
|
|
82
|
+
...Se,
|
|
69
83
|
container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
70
84
|
stringValue: "text-orange-600",
|
|
71
85
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -79,7 +93,7 @@ function Ee({
|
|
|
79
93
|
name: a,
|
|
80
94
|
onRemove: t
|
|
81
95
|
}) {
|
|
82
|
-
const { t: l } =
|
|
96
|
+
const { t: l } = g();
|
|
83
97
|
return /* @__PURE__ */ e.jsxs(re, { children: [
|
|
84
98
|
/* @__PURE__ */ e.jsx(ie, { asChild: !0, children: s }),
|
|
85
99
|
/* @__PURE__ */ e.jsxs(te, { children: [
|
|
@@ -100,29 +114,29 @@ function Ee({
|
|
|
100
114
|
] });
|
|
101
115
|
}
|
|
102
116
|
const ze = () => {
|
|
103
|
-
const { t: s } =
|
|
104
|
-
N(a, (r) =>
|
|
105
|
-
), [k,
|
|
106
|
-
a.map((r) =>
|
|
107
|
-
(r) => !
|
|
117
|
+
const { t: s } = g(), a = Z(() => De(), []), [t, l] = me(), [, h] = O(xe), [d, c] = p(
|
|
118
|
+
N(a, (r) => B(t, "providerKey").includes(r.providerKey))
|
|
119
|
+
), [k, u] = p(""), [C, b] = p(null), D = N(
|
|
120
|
+
a.map((r) => B(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
|
|
121
|
+
(r) => !X(r)
|
|
108
122
|
), T = (r) => {
|
|
109
|
-
const m =
|
|
110
|
-
c((i) => [...i, m]), l((i) => [...i, { providerKey: m.providerKey, args: {} }]),
|
|
111
|
-
},
|
|
112
|
-
c((m) => N(m, (i) => i.providerKey !== r.providerKey)), l((m) => N(m, (i) => i.providerKey !== r.providerKey)),
|
|
113
|
-
}, n = (r) =>
|
|
114
|
-
return
|
|
123
|
+
const m = $(a, { providerKey: r });
|
|
124
|
+
c((i) => [...i, m]), l((i) => [...i, { providerKey: m.providerKey, args: {} }]), u(""), h("UNSAVED");
|
|
125
|
+
}, y = (r) => {
|
|
126
|
+
c((m) => N(m, (i) => i.providerKey !== r.providerKey)), l((m) => N(m, (i) => i.providerKey !== r.providerKey)), h("UNSAVED");
|
|
127
|
+
}, n = (r) => b(r);
|
|
128
|
+
return q(a) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
115
129
|
s("no_data_providers"),
|
|
116
130
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
117
131
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
|
|
118
132
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
119
133
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
120
134
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
|
|
121
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
122
|
-
/* @__PURE__ */ e.jsx(
|
|
135
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(pe, { value: k, onValueChange: (r) => T(r), children: [
|
|
136
|
+
/* @__PURE__ */ e.jsx(he, { className: "w-full", children: /* @__PURE__ */ e.jsx(ue, { placeholder: s("select_provider") }) }),
|
|
123
137
|
/* @__PURE__ */ e.jsxs(fe, { children: [
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
-
D.map((r) => /* @__PURE__ */ e.jsx(
|
|
138
|
+
/* @__PURE__ */ e.jsx(K, { value: "", children: s("choose") }),
|
|
139
|
+
D.map((r) => /* @__PURE__ */ e.jsx(K, { value: r.value, children: r.label }, r.value))
|
|
126
140
|
] })
|
|
127
141
|
] }) }),
|
|
128
142
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -171,7 +185,7 @@ const ze = () => {
|
|
|
171
185
|
]
|
|
172
186
|
}
|
|
173
187
|
),
|
|
174
|
-
/* @__PURE__ */ e.jsx(Ee, { onRemove: () =>
|
|
188
|
+
/* @__PURE__ */ e.jsx(Ee, { onRemove: () => y(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: [
|
|
175
189
|
/* @__PURE__ */ e.jsxs(
|
|
176
190
|
"svg",
|
|
177
191
|
{
|
|
@@ -199,11 +213,11 @@ const ze = () => {
|
|
|
199
213
|
},
|
|
200
214
|
r.providerKey
|
|
201
215
|
)) }),
|
|
202
|
-
/* @__PURE__ */ e.jsx(
|
|
216
|
+
/* @__PURE__ */ e.jsx(Ke, { onClose: () => b(null), provider: C })
|
|
203
217
|
] })
|
|
204
218
|
] });
|
|
205
|
-
}, Le =
|
|
206
|
-
const { t: s } =
|
|
219
|
+
}, Le = W(() => {
|
|
220
|
+
const { t: s } = g(), a = {
|
|
207
221
|
"ctrl + Z": "Undo",
|
|
208
222
|
"ctrl + Y": "Redo",
|
|
209
223
|
"ctrl + D": "Duplicate"
|
|
@@ -213,8 +227,8 @@ const ze = () => {
|
|
|
213
227
|
esc: "Deselect blocks",
|
|
214
228
|
del: "Delete block"
|
|
215
229
|
};
|
|
216
|
-
return /* @__PURE__ */ e.jsxs(
|
|
217
|
-
/* @__PURE__ */ e.jsx(
|
|
230
|
+
return /* @__PURE__ */ e.jsxs(M, { children: [
|
|
231
|
+
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
218
232
|
/* @__PURE__ */ e.jsx(ge, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(R, {}) }) }),
|
|
219
233
|
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
|
|
220
234
|
] }) }),
|
|
@@ -232,21 +246,21 @@ const ze = () => {
|
|
|
232
246
|
] }) })
|
|
233
247
|
] })
|
|
234
248
|
] });
|
|
235
|
-
}),
|
|
236
|
-
let
|
|
237
|
-
const
|
|
238
|
-
const s = w("sideBarComponents.top", []), a = w("sideBarComponents.bottom", []), [t, l] =
|
|
239
|
-
"add-blocks":
|
|
240
|
-
[o]:
|
|
241
|
-
"theme-configuration":
|
|
242
|
-
images:
|
|
243
|
-
"ui-libraries":
|
|
249
|
+
}), Ie = v(() => import("./index-lFgDm1oa.js").then((s) => s.g)), _ = v(() => import("./index-lFgDm1oa.js").then((s) => s.f)), Ve = v(() => import("./index-lFgDm1oa.js").then((s) => s.h)), Oe = v(() => import("./index-C7mB4XFm.js").then((s) => s.cw)), Me = v(() => import("./UILibrariesPanel-NVUMUPUj.js")), He = () => /* @__PURE__ */ e.jsx("div", { className: "w-72", children: /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full animate-pulse rounded-md bg-gray-100" }), children: /* @__PURE__ */ e.jsx(Ie, {}) }) });
|
|
250
|
+
let V = null;
|
|
251
|
+
const $s = () => {
|
|
252
|
+
const s = w("sideBarComponents.top", []), a = w("sideBarComponents.bottom", []), [t, l] = O(ye), [h, d] = p(t), [c, k] = p(null), { t: u } = g(), C = w("uiLibraries", []), b = Te(), D = G(b).find((i) => i.category === "custom") !== void 0, T = C.length > 0 || D, y = {
|
|
253
|
+
"add-blocks": He,
|
|
254
|
+
[o]: _,
|
|
255
|
+
"theme-configuration": Ve,
|
|
256
|
+
images: Oe,
|
|
257
|
+
"ui-libraries": Me
|
|
244
258
|
};
|
|
245
|
-
Q(s, ({ name: i, panel:
|
|
246
|
-
|
|
259
|
+
Q(s, ({ name: i, panel: A }) => {
|
|
260
|
+
y[i] = A;
|
|
247
261
|
});
|
|
248
262
|
const n = (i) => {
|
|
249
|
-
clearTimeout(
|
|
263
|
+
clearTimeout(V), t !== o && i === o ? V = setTimeout(() => l(o), 500) : d(i), l(i);
|
|
250
264
|
}, r = w("dataBindingSupport", !1);
|
|
251
265
|
function m() {
|
|
252
266
|
const i = setTimeout(() => {
|
|
@@ -299,7 +313,7 @@ const zs = () => {
|
|
|
299
313
|
onClick: () => n(o),
|
|
300
314
|
size: "sm",
|
|
301
315
|
variant: t === o ? "default" : "outline",
|
|
302
|
-
children: /* @__PURE__ */ e.jsx(
|
|
316
|
+
children: /* @__PURE__ */ e.jsx(P, { className: "w-4" })
|
|
303
317
|
}
|
|
304
318
|
),
|
|
305
319
|
/* @__PURE__ */ e.jsx(
|
|
@@ -312,14 +326,14 @@ const zs = () => {
|
|
|
312
326
|
}
|
|
313
327
|
),
|
|
314
328
|
f.Children.toArray(
|
|
315
|
-
s.map(({ name: i, icon:
|
|
329
|
+
s.map(({ name: i, icon: A }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
316
330
|
x,
|
|
317
331
|
{
|
|
318
332
|
onClick: () => n(i),
|
|
319
333
|
size: "sm",
|
|
320
334
|
className: "w-10",
|
|
321
335
|
variant: t === i ? "default" : "outline",
|
|
322
|
-
children: /* @__PURE__ */ e.jsx(
|
|
336
|
+
children: /* @__PURE__ */ e.jsx(A, {})
|
|
323
337
|
}
|
|
324
338
|
) }))
|
|
325
339
|
)
|
|
@@ -327,7 +341,7 @@ const zs = () => {
|
|
|
327
341
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
328
342
|
/* @__PURE__ */ e.jsx(Le, {}),
|
|
329
343
|
f.Children.toArray(
|
|
330
|
-
a.map((i) => /* @__PURE__ */ e.jsx(
|
|
344
|
+
a.map((i) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(i, {}) }))
|
|
331
345
|
)
|
|
332
346
|
] })
|
|
333
347
|
] }),
|
|
@@ -336,7 +350,7 @@ const zs = () => {
|
|
|
336
350
|
{
|
|
337
351
|
className: "absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
|
|
338
352
|
children: /* @__PURE__ */ e.jsx(
|
|
339
|
-
|
|
353
|
+
j,
|
|
340
354
|
{
|
|
341
355
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
|
|
342
356
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -346,13 +360,13 @@ const zs = () => {
|
|
|
346
360
|
children: /* @__PURE__ */ e.jsx(
|
|
347
361
|
"div",
|
|
348
362
|
{
|
|
349
|
-
className:
|
|
363
|
+
className: Be(
|
|
350
364
|
"relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"
|
|
351
365
|
),
|
|
352
366
|
onMouseEnter: () => {
|
|
353
367
|
c && clearTimeout(c);
|
|
354
368
|
},
|
|
355
|
-
children: f.createElement(ee(
|
|
369
|
+
children: f.createElement(ee(y, t, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
356
370
|
}
|
|
357
371
|
)
|
|
358
372
|
}
|
|
@@ -360,7 +374,7 @@ const zs = () => {
|
|
|
360
374
|
}
|
|
361
375
|
) : null,
|
|
362
376
|
/* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
|
|
363
|
-
|
|
377
|
+
j,
|
|
364
378
|
{
|
|
365
379
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
|
|
366
380
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -370,29 +384,29 @@ const zs = () => {
|
|
|
370
384
|
children: r ? /* @__PURE__ */ e.jsxs(Ne, { defaultValue: o, className: "flex h-full w-full flex-col py-1", children: [
|
|
371
385
|
/* @__PURE__ */ e.jsxs(we, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
372
386
|
/* @__PURE__ */ e.jsxs(L, { value: o, children: [
|
|
373
|
-
/* @__PURE__ */ e.jsx(
|
|
387
|
+
/* @__PURE__ */ e.jsx(P, { className: "mr-2 h-3" }),
|
|
374
388
|
" ",
|
|
375
|
-
|
|
389
|
+
u("Outline")
|
|
376
390
|
] }),
|
|
377
391
|
/* @__PURE__ */ e.jsxs(L, { value: "data-provider", children: [
|
|
378
392
|
/* @__PURE__ */ e.jsx(Ce, { className: "mr-2 w-3" }),
|
|
379
|
-
|
|
393
|
+
u("Data")
|
|
380
394
|
] })
|
|
381
395
|
] }),
|
|
382
|
-
/* @__PURE__ */ e.jsx(
|
|
383
|
-
/* @__PURE__ */ e.jsx(
|
|
396
|
+
/* @__PURE__ */ e.jsx(I, { value: o, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(_) }),
|
|
397
|
+
/* @__PURE__ */ e.jsx(I, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ze, {}) })
|
|
384
398
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
385
399
|
/* @__PURE__ */ e.jsxs("div", { className: "sticky top-0 -m-1 flex h-fit items-center justify-center border-b bg-gray-100 py-2 pb-[9px] text-sm", children: [
|
|
386
|
-
/* @__PURE__ */ e.jsx(
|
|
400
|
+
/* @__PURE__ */ e.jsx(P, { className: "mr-2 h-3" }),
|
|
387
401
|
" ",
|
|
388
|
-
|
|
402
|
+
u("Outline")
|
|
389
403
|
] }),
|
|
390
|
-
/* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2", children: f.createElement(
|
|
404
|
+
/* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2", children: f.createElement(_) })
|
|
391
405
|
] })
|
|
392
406
|
}
|
|
393
407
|
) })
|
|
394
408
|
] });
|
|
395
409
|
};
|
|
396
410
|
export {
|
|
397
|
-
|
|
411
|
+
$s as default
|
|
398
412
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),b=require("@radix-ui/react-icons"),i=require("react"),D=require("jotai"),u=require("lodash-es"),s=require("./index-aeDphKpP.cjs"),E=require("lucide-react"),S=require("@chaibuilder/runtime"),v=require("react-i18next"),R=require("./index-5XyNUAjc.cjs"),a=require("./MODIFIERS-mVmfEGgo.cjs"),P=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@react-hookz/web");require("tree-model");require("i18next");require("react-arborist");require("./index--mLLy7QQ.cjs");require("prop-types");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("./html-to-json-NqRjgFqp.cjs");require("himalaya");require("lodash");require("react-wrap-balancer");require("@rjsf/core");require("@rjsf/validator-ajv8");require("react-autosuggest");require("fuse.js");require("./controls-rRZhz0vu.cjs");const I=({provider:t,onClose:x})=>{const{t:o}=v.useTranslation(),[l,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(d=>p(d))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:m=>m?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(R.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(R.JsonView,{data:l,shouldExpandNode:R.allExpanded,style:{...R.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 _({children:t,name:x,onRemove:o}){const{t:l}=v.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:l("remove_provider_confirmation").replace("{name}",x)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:o,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const K=()=>{const{t}=v.useTranslation(),x=i.useMemo(()=>S.getChaiDataProviders(),[]),[o,l]=s.usePageDataProviders(),[,p]=D.useAtom(s.builderSaveStateAtom),[m,d]=i.useState(u.filter(x,r=>u.map(o,"providerKey").includes(r.providerKey))),[N,h]=i.useState(""),[y,f]=i.useState(null),q=u.filter(x.map(r=>u.map(m,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),w=r=>{const j=u.find(x,{providerKey:r});d(n=>[...n,j]),l(n=>[...n,{providerKey:j.providerKey,args:{}}]),h(""),p("UNSAVED")},g=r=>{d(j=>u.filter(j,n=>n.providerKey!==r.providerKey)),l(j=>u.filter(j,n=>n.providerKey!==r.providerKey)),p("UNSAVED")},c=r=>f(r);return u.isEmpty(x)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:N,onValueChange:r=>w(r),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:t("choose")}),q.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:()=>c(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(_,{onRemove:()=>g(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(I,{onClose:()=>f(null),provider:y})]})]})},L=i.memo(()=>{const{t}=v.useTranslation(),x={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("div",{className:"flex w-10 items-center justify-center",children:e.jsxRuntimeExports.jsx(b.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(x).map(l=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(l)}),e.jsxRuntimeExports.jsx("div",{children:t(x[l])})]},l))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(l=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(l)}),e.jsxRuntimeExports.jsx("div",{children:t(o[l])})]},l))})]})})]})]})}),B=i.lazy(()=>Promise.resolve().then(()=>require("./index-5XyNUAjc.cjs")).then(t=>t.AddBlocks)),T=i.lazy(()=>Promise.resolve().then(()=>require("./index-5XyNUAjc.cjs")).then(t=>t.ListTree$1)),A=i.lazy(()=>Promise.resolve().then(()=>require("./index-5XyNUAjc.cjs")).then(t=>t.ThemeConfigPanel$1)),O=i.lazy(()=>Promise.resolve().then(()=>require("./index-aeDphKpP.cjs")).then(t=>t.ImagesPanel)),U=i.lazy(()=>Promise.resolve().then(()=>require("./UILibrariesPanel-7btHgBD0.cjs"))),z=()=>e.jsxRuntimeExports.jsx("div",{className:"w-72",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full animate-pulse rounded-md bg-gray-100"}),children:e.jsxRuntimeExports.jsx(B,{})})});let C=null;const Y=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[o,l]=D.useAtom(s.activePanelAtom),[p,m]=i.useState(o),[d,N]=i.useState(null),{t:h}=v.useTranslation(),y=s.useBuilderProp("uiLibraries",[]),f=S.useChaiBlocks(),q=u.values(f).find(n=>n.category==="custom")!==void 0,w=y.length>0||q,g={"add-blocks":z,[a.OUTLINE_KEY]:T,"theme-configuration":A,images:O,"ui-libraries":U};u.each(t,({name:n,panel:k})=>{g[n]=k});const c=n=>{clearTimeout(C),o!==a.OUTLINE_KEY&&n===a.OUTLINE_KEY?C=setTimeout(()=>l(a.OUTLINE_KEY),500):m(n),l(n)},r=s.useBuilderProp("dataBindingSupport",!1);function j(){const n=setTimeout(()=>{d&&(c(a.OUTLINE_KEY),clearTimeout(d))},500);N(n)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[o!==a.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:j,onClick:()=>c(a.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[w?e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 rounded-md bg-gray-200 p-1",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("add-blocks"),size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(b.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("ui-libraries"),size:"sm",variant:o==="ui-libraries"?"default":"outline",children:e.jsxRuntimeExports.jsx(b.Component2Icon,{className:"text-xl"})})]}):e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("add-blocks"),size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(b.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c(a.OUTLINE_KEY),size:"sm",variant:o===a.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c("theme-configuration"),size:"sm",variant:o==="theme-configuration"?"default":"outline",children:e.jsxRuntimeExports.jsx(E.PaletteIcon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:n,icon:k})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>c(n),size:"sm",className:"w-10",variant:o===n?"default":"outline",children:e.jsxRuntimeExports.jsx(k,{})})})))]}),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(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]}),o!==a.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:P.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(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:r?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:a.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:a.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(E.DatabaseIcon,{className:"mr-2 w-3"}),h("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:a.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(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.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sticky top-0 -m-1 flex h-fit items-center justify-center border-b bg-gray-100 py-2 pb-[9px] text-sm",children:[e.jsxRuntimeExports.jsx(E.ListTreeIcon,{className:"mr-2 h-3"})," ",h("Outline")]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2",children:i.createElement(T)})]})})})]})};exports.default=Y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("react"),a=require("@radix-ui/react-icons"),r=require("./index-aeDphKpP.cjs"),p=require("./index-5XyNUAjc.cjs"),l=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("i18next");require("react-arborist");require("lucide-react");require("./index--mLLy7QQ.cjs");require("prop-types");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("./html-to-json-NqRjgFqp.cjs");require("himalaya");require("lodash");require("react-wrap-balancer");require("@rjsf/core");require("@rjsf/validator-ajv8");require("react-autosuggest");require("fuse.js");require("./controls-rRZhz0vu.cjs");const m=()=>r.useBuilderProp("languages",["en"]),j=()=>m().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(a.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),d=()=>{const{savePage:u,saveState:s}=r.useSavePage(),{t:n}=l.useTranslation(),x=r.useBuilderProp("hideSaveButton",!1),t=i.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[s]);if(x)return null;const o=e.jsxRuntimeExports.jsxs(r.Button,{disabled:s==="SAVING",onClick:c=>{c.preventDefault(),u()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${t}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(p.FaCircleCheck,{className:"text-lg"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:s==="SAVING"?"Saving...":n(s==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},q=function(){const s=r.useBuilderProp("previewComponent"),[,n]=r.usePreviewMode(),{t:x}=l.useTranslation();return s?e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),n(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(a.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:x("Preview")})]}):null},h=()=>{const u=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),n=r.useBuilderProp("topBarComponents.right",[]),x=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:i.Children.toArray(u.map(t=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:i.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(j,{}),e.jsxRuntimeExports.jsx(q,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),x?e.jsxRuntimeExports.jsx(d,{}):null,i.Children.toArray(n.map(t=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=h;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import l, { useMemo as h, Suspense as
|
|
2
|
+
import l, { useMemo as h, Suspense as m } from "react";
|
|
3
3
|
import { FontFamilyIcon as j, EyeOpenIcon as f } from "@radix-ui/react-icons";
|
|
4
|
-
import { h as
|
|
5
|
-
import {
|
|
4
|
+
import { h as s, bw as g, bx as v, by as b, bz as N, bD as S, bE as w, bA as n, b9 as y, B as c, a2 as C, a3 as p, bF as B } from "./index-C7mB4XFm.js";
|
|
5
|
+
import { F as A } from "./index-lFgDm1oa.js";
|
|
6
6
|
import { useTranslation as x } from "react-i18next";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "@radix-ui/react-toggle";
|
|
@@ -42,10 +42,25 @@ import "i18next";
|
|
|
42
42
|
import "react-arborist";
|
|
43
43
|
import "lucide-react";
|
|
44
44
|
import "./index-VBXQixVm.js";
|
|
45
|
+
import "prop-types";
|
|
46
|
+
import "react-hotkeys-hook";
|
|
47
|
+
import "@floating-ui/dom";
|
|
45
48
|
import "@floating-ui/react-dom";
|
|
46
49
|
import "flagged";
|
|
47
|
-
import "
|
|
48
|
-
|
|
50
|
+
import "@tailwindcss/typography";
|
|
51
|
+
import "@tailwindcss/forms";
|
|
52
|
+
import "@tailwindcss/aspect-ratio";
|
|
53
|
+
import "tailwindcss-palette-generator";
|
|
54
|
+
import "./html-to-json-l_mw5y-e.js";
|
|
55
|
+
import "himalaya";
|
|
56
|
+
import "lodash";
|
|
57
|
+
import "react-wrap-balancer";
|
|
58
|
+
import "@rjsf/core";
|
|
59
|
+
import "@rjsf/validator-ajv8";
|
|
60
|
+
import "react-autosuggest";
|
|
61
|
+
import "fuse.js";
|
|
62
|
+
import "./controls-yjgoZzB6.js";
|
|
63
|
+
const P = () => s("languages", ["en"]), k = () => P().length === 1 ? null : /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsxs(g, { children: [
|
|
49
64
|
/* @__PURE__ */ e.jsx(v, { className: "w-[150px] border-0", children: /* @__PURE__ */ e.jsx(
|
|
50
65
|
b,
|
|
51
66
|
{
|
|
@@ -57,14 +72,14 @@ const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @
|
|
|
57
72
|
) }),
|
|
58
73
|
/* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs(S, { children: [
|
|
59
74
|
/* @__PURE__ */ e.jsx(w, { children: "Fruits" }),
|
|
60
|
-
/* @__PURE__ */ e.jsx(
|
|
61
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
/* @__PURE__ */ e.jsx(
|
|
64
|
-
/* @__PURE__ */ e.jsx(
|
|
75
|
+
/* @__PURE__ */ e.jsx(n, { value: "apple", children: "Apple" }),
|
|
76
|
+
/* @__PURE__ */ e.jsx(n, { value: "banana", children: "Banana" }),
|
|
77
|
+
/* @__PURE__ */ e.jsx(n, { value: "blueberry", children: "Blueberry" }),
|
|
78
|
+
/* @__PURE__ */ e.jsx(n, { value: "grapes", children: "Grapes" }),
|
|
79
|
+
/* @__PURE__ */ e.jsx(n, { value: "pineapple", children: "Pineapple" })
|
|
65
80
|
] }) })
|
|
66
|
-
] }) }),
|
|
67
|
-
const { savePage:
|
|
81
|
+
] }) }), E = () => {
|
|
82
|
+
const { savePage: i, saveState: t } = y(), { t: a } = x(), o = s("hideSaveButton", !1), r = h(() => {
|
|
68
83
|
switch (t) {
|
|
69
84
|
case "SAVING":
|
|
70
85
|
return "animate-pulse bg-gray-300 text-gray-900";
|
|
@@ -74,16 +89,16 @@ const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @
|
|
|
74
89
|
return "bg-gray-200 text-gray-500 hover:bg-gray-100";
|
|
75
90
|
}
|
|
76
91
|
}, [t]);
|
|
77
|
-
if (
|
|
92
|
+
if (o)
|
|
78
93
|
return null;
|
|
79
94
|
const u = /* @__PURE__ */ e.jsxs(
|
|
80
|
-
|
|
95
|
+
c,
|
|
81
96
|
{
|
|
82
97
|
disabled: t === "SAVING",
|
|
83
98
|
onClick: (d) => {
|
|
84
|
-
d.preventDefault(),
|
|
99
|
+
d.preventDefault(), i();
|
|
85
100
|
},
|
|
86
|
-
className: `flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${
|
|
101
|
+
className: `flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${r}`,
|
|
87
102
|
size: "sm",
|
|
88
103
|
variant: "outline",
|
|
89
104
|
children: [
|
|
@@ -93,43 +108,43 @@ const P = () => r("languages", ["en"]), k = () => P().length === 1 ? null : /* @
|
|
|
93
108
|
}
|
|
94
109
|
);
|
|
95
110
|
return /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: u });
|
|
96
|
-
},
|
|
97
|
-
const t =
|
|
111
|
+
}, F = function() {
|
|
112
|
+
const t = s("previewComponent"), [, a] = C(), { t: o } = x();
|
|
98
113
|
return t ? /* @__PURE__ */ e.jsxs(
|
|
99
|
-
|
|
114
|
+
c,
|
|
100
115
|
{
|
|
101
|
-
onClick: (
|
|
102
|
-
|
|
116
|
+
onClick: (r) => {
|
|
117
|
+
r.preventDefault(), a(!0);
|
|
103
118
|
},
|
|
104
119
|
className: "flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",
|
|
105
120
|
size: "sm",
|
|
106
121
|
variant: "outline",
|
|
107
122
|
children: [
|
|
108
123
|
/* @__PURE__ */ e.jsx(f, { className: "text-xs" }),
|
|
109
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children:
|
|
124
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children: o("Preview") })
|
|
110
125
|
]
|
|
111
126
|
}
|
|
112
127
|
) : null;
|
|
113
|
-
},
|
|
114
|
-
const
|
|
128
|
+
}, Re = () => {
|
|
129
|
+
const i = s("topBarComponents.left", []), t = s("topBarComponents.center", []), a = s("topBarComponents.right", []), o = s("editable", !0);
|
|
115
130
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
116
131
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 font-bold", children: l.Children.toArray(
|
|
117
|
-
|
|
132
|
+
i.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
|
|
118
133
|
) }) }),
|
|
119
134
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: l.Children.toArray(
|
|
120
|
-
t.map((
|
|
135
|
+
t.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
|
|
121
136
|
) }),
|
|
122
137
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
123
138
|
/* @__PURE__ */ e.jsx(k, {}),
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
139
|
+
/* @__PURE__ */ e.jsx(F, {}),
|
|
125
140
|
/* @__PURE__ */ e.jsx(B, { orientation: "vertical" }),
|
|
126
|
-
|
|
141
|
+
o ? /* @__PURE__ */ e.jsx(E, {}) : null,
|
|
127
142
|
l.Children.toArray(
|
|
128
|
-
a.map((
|
|
143
|
+
a.map((r) => /* @__PURE__ */ e.jsx(m, { fallback: /* @__PURE__ */ e.jsx(p, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(r, {}) }))
|
|
129
144
|
)
|
|
130
145
|
] })
|
|
131
146
|
] });
|
|
132
147
|
};
|
|
133
148
|
export {
|
|
134
|
-
|
|
149
|
+
Re as default
|
|
135
150
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("lodash-es"),f=require("react"),s=require("./index-aeDphKpP.cjs"),y=require("@chaibuilder/runtime"),I=require("lucide-react"),q=require("jotai"),C=require("./Functions-N3yhPYKY.cjs"),B=require("@radix-ui/react-icons"),L=require("./MODIFIERS-mVmfEGgo.cjs"),S=require("react-i18next"),T=require("./index-5XyNUAjc.cjs"),A=require("clsx"),P=require("flagged");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.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-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@react-hookz/web");require("tree-model");require("i18next");require("react-arborist");require("./index--mLLy7QQ.cjs");require("prop-types");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("./html-to-json-NqRjgFqp.cjs");require("himalaya");require("lodash");require("react-wrap-balancer");require("@rjsf/core");require("@rjsf/validator-ajv8");require("react-autosuggest");require("fuse.js");require("./controls-rRZhz0vu.cjs");function O(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(i,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return i.default=t,Object.freeze(i)}const D=O(f);function _({uiLibraries:t,library:i,setLibrary:o}){var p;const[l,x]=D.useState(!1),{t:n}=S.useTranslation();return i?e.jsxRuntimeExports.jsxs(s.Popover,{open:l,onOpenChange:x,children:[e.jsxRuntimeExports.jsx(s.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("span",{children:n("Choose Library")}),e.jsxRuntimeExports.jsxs(s.Button,{variant:"outline",size:"sm",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[i?(p=t.find(u=>u.uuid===i))==null?void 0:p.name:n("Select library"),e.jsxRuntimeExports.jsx(B.CaretSortIcon,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})]})}),e.jsxRuntimeExports.jsx(s.PopoverContent,{className:"w-[200px] p-0",children:e.jsxRuntimeExports.jsxs(s.Command,{children:[e.jsxRuntimeExports.jsx(s.CommandInput,{placeholder:"Search library...",className:"h-9"}),e.jsxRuntimeExports.jsxs(s.CommandList,{children:[e.jsxRuntimeExports.jsx(s.CommandEmpty,{children:"No library found."}),e.jsxRuntimeExports.jsx(s.CommandGroup,{children:t.map(u=>e.jsxRuntimeExports.jsxs(s.CommandItem,{value:u.uuid,onSelect:j=>{o(j),x(!1)},children:[u.name,e.jsxRuntimeExports.jsx(B.CheckIcon,{className:C.cn("ml-auto h-4 w-4",i===u.uuid?"opacity-100":"opacity-0")})]},u.uuid))})]})]})})]}):null}const M=({block:t,closePopover:i,library:o})=>{const[l,x]=f.useState(!1),n=s.useBuilderProp("getUILibraryBlock",r.noop),{addCoreBlock:p,addPredefinedBlock:u}=s.useAddBlock(),[j,E]=s.useSelectedBlockIds(),[,R]=s.useHighlightBlockId(),g=r.get(t,"name",r.get(t,"label")),b=P.useFeature("dnd"),[,k]=q.useAtom(T.draggedBlockAtom),a=c=>{const m=r.has(c,"styles_attrs.data-page-section");return c._type==="Box"&&m},v=f.useCallback(async c=>{if(c.stopPropagation(),r.has(t,"component")){p(t,r.first(j)),i();return}x(!0);const m=await n(o,t);let h=r.first(j);a(r.first(m))&&(h=null),r.isEmpty(m)||u(y.syncBlocksWithDefaults(m),h),i()},[t]),d=async c=>{const m=await n(o,t);let h=r.first(j);if(a(r.first(m))&&(h=null),!r.isEmpty(m)){const N={blocks:m,uiLibrary:!0,parent:h};if(c.dataTransfer.setData("text/plain",JSON.stringify(N)),t.preview){const w=new Image;w.src=t.preview,w.onload=()=>{c.dataTransfer.setDragImage(w,0,0)}}else c.dataTransfer.setDragImage(new Image,0,0);k(N),setTimeout(()=>{E([]),R(null),i()},200)}};return e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{onClick:l?()=>{}:v,draggable:b?"true":"false",onDragStart:d,className:A("relative mt-2 cursor-pointer overflow-hidden rounded-md border border-gray-300 bg-white duration-200 hover:border-blue-500 hover:shadow-xl"),children:[l&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(I.Loader,{className:"animate-spin",size:15,color:"white"}),e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),t.preview?e.jsxRuntimeExports.jsx("img",{src:t.preview,className:"min-h-[25px] w-full rounded-md",alt:g}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:g})})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:g})})]})},U=q.atom({}),z=t=>{const[i,o]=q.useAtom(U),l=s.useBuilderProp("getUILibraryBlocks",r.noop),x=r.get(i,`${t==null?void 0:t.uuid}.blocks`,[]),n=r.get(i,`${t==null?void 0:t.uuid}.loading`,!1);return f.useEffect(()=>{(async()=>{if(n||x.length>0||!t)return;o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!0,blocks:[]}}));const p=await l(t);o(u=>({...u,[t==null?void 0:t.uuid]:{loading:!1,blocks:p||[]}}))})()},[t,x,n]),{data:x,isLoading:n}},F=s.atomWithStorage("_selectedLibrary",null),G=()=>{const[t,i]=q.useAtom(F),o=s.useBuilderProp("uiLibraries",[]),l=y.useChaiBlocks(),x=r.values(l).filter(d=>d.category==="custom"),n=o.find(d=>d.uuid===t)||r.first(o),{data:p,isLoading:u}=z(n),j=r.groupBy([...p,...x],"group"),[E,R]=f.useState("Hero"),[,g]=q.useAtom(s.activePanelAtom),b=r.get(j,E,[]),{t:k}=S.useTranslation(),a=f.useRef(null),v=d=>{a.current&&(clearTimeout(a.current),a.current=null),a.current=setTimeout(()=>{a.current&&R(d)},300)};return u?e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-full w-full"}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full w-[460px] flex-col overflow-hidden bg-background",children:[n!=null&&n.uuid?e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex h-fit flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:e.jsxRuntimeExports.jsx("h1",{className:"flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col",children:e.jsxRuntimeExports.jsx(_,{library:n==null?void 0:n.uuid,setLibrary:i,uiLibraries:o})})})}):null,e.jsxRuntimeExports.jsxs("div",{className:"flex h-[95%] border-t border-gray-300 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex h-full w-40 flex-col gap-1 px-1",children:f.Children.toArray(r.map(j,(d,c)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>v(c),onMouseLeave:()=>clearTimeout(a.current),onClick:()=>R(c),className:C.cn("flex w-full cursor-pointer items-center justify-between rounded-md p-1 text-sm transition-all ease-in-out hover:bg-gray-200",c===E?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:r.capitalize(c)}),e.jsxRuntimeExports.jsx(B.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},c)))}),e.jsxRuntimeExports.jsxs(s.ScrollArea,{onMouseEnter:()=>a.current?clearTimeout(a.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 transition-all ease-linear",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 z-30 border-b border-gray-300 bg-gray-200 p-2 text-[9px] font-light leading-3 text-gray-500",children:k("Click on a block to add it to the page")}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2 px-2",children:f.Children.toArray(b.map(d=>e.jsxRuntimeExports.jsx(M,{block:d,library:n,closePopover:()=>g(L.OUTLINE_KEY)})))}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})]})]})})},H=()=>e.jsxRuntimeExports.jsx(G,{});exports.default=H;
|