@chaibuilder/sdk 1.2.39 → 1.2.41
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-p4Hrxjdf.cjs → AddBlocks-M0Ai5QRA.cjs} +1 -1
- package/dist/{AddBlocks-2_dpKDpp.js → AddBlocks-axw0eS0q.js} +1 -1
- package/dist/{CanvasArea-iN0LxF74.js → CanvasArea-CWXelVxd.js} +2 -2
- package/dist/{CanvasArea-sbec3R-f.cjs → CanvasArea-iPwNNbdH.cjs} +1 -1
- package/dist/{ChaiBuilderEditor-JnZFji5_.js → ChaiBuilderEditor-3Wj_t3jA.js} +3535 -3532
- package/dist/{ChaiBuilderEditor-qxbkVVLu.cjs → ChaiBuilderEditor-syigvGWW.cjs} +37 -37
- package/dist/{CurrentPage-m7_GkZ8a.cjs → CurrentPage-iniQPv9U.cjs} +1 -1
- package/dist/{CurrentPage-Lr3ztuMx.js → CurrentPage-nER7hH4h.js} +2 -2
- package/dist/{ListTree-piETqoz9.cjs → ListTree-biNayajJ.cjs} +1 -1
- package/dist/{ListTree-uJFhqUk9.js → ListTree-hYx4RLqK.js} +1 -1
- package/dist/{PagesPanel-R8FWg5Xg.js → PagesPanel-LtuJLoQJ.js} +3 -3
- package/dist/{PagesPanel-lShO3SmJ.cjs → PagesPanel-mFjGqRwI.cjs} +1 -1
- package/dist/{ProjectPanel-2dX4bM5q.js → ProjectPanel-g2wBPuXq.js} +3 -3
- package/dist/{ProjectPanel-_4546hym.cjs → ProjectPanel-s87fBlvB.cjs} +1 -1
- package/dist/{Settings-e2AZkjqY.cjs → Settings-YEIKf61W.cjs} +1 -1
- package/dist/{Settings-J785mqWv.js → Settings-sL6SfNst.js} +2 -2
- package/dist/SidePanels-f7N3ZWmB.cjs +1 -0
- package/dist/{SidePanels-cN9er64h.js → SidePanels-gJa61XBn.js} +135 -135
- package/dist/{ThemeConfiguration-m_jkR2zi.js → ThemeConfiguration-5lCjeQNl.js} +1 -1
- package/dist/{ThemeConfiguration-nler1cz3.cjs → ThemeConfiguration-bOyg0yqs.cjs} +1 -1
- package/dist/{Topbar-gaBycI3a.js → Topbar-22iB6xT8.js} +1 -1
- package/dist/{Topbar-DmIPkF8D.cjs → Topbar-YyBsZjuO.cjs} +1 -1
- package/dist/UILibrariesPanel-50360foB.cjs +1 -0
- package/dist/UILibrariesPanel-p5kL4hPY.js +145 -0
- package/dist/{UnsplashImages-6HmGnetM.js → UnsplashImages-3-5Y4PKF.js} +1 -1
- package/dist/{UnsplashImages-mC2ewX9D.cjs → UnsplashImages-IxQo6rWq.cjs} +1 -1
- package/dist/{UploadImages-fo9ufcCE.cjs → UploadImages-p0g4eMUM.cjs} +1 -1
- package/dist/{UploadImages-qRW8zhKj.js → UploadImages-sAW1x_IX.js} +1 -1
- package/dist/{add-page-modal-0OuVNgx3.js → add-page-modal-UIhX5RaH.js} +3 -3
- package/dist/{add-page-modal-mP9aTfG9.cjs → add-page-modal-f5mO9mWn.cjs} +1 -1
- package/dist/{confirm-alert-3cDnni4v.cjs → confirm-alert-6_2P1iPG.cjs} +1 -1
- package/dist/{confirm-alert-Mv-Iofef.js → confirm-alert-yjv50jW-.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +19 -3
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-BVz9nreM.js → delete-page-modal-4RNg8OWW.js} +2 -2
- package/dist/{delete-page-modal-PTwcrTET.cjs → delete-page-modal-eXCSYimZ.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +19 -3
- package/dist/email.js +1 -1
- package/dist/{form-e8l4xtI9.js → form-Zy8G3TfH.js} +1 -1
- package/dist/{form-o7e6NNTk.cjs → form-gTqkjR1L.cjs} +1 -1
- package/dist/{index-CdnwVCXv.js → index-aYfwM1sV.js} +2 -2
- package/dist/{index--XTVdy1h.cjs → index-m6gyJ5Ma.cjs} +1 -1
- package/dist/{page-viewer-cjvx3lg7.cjs → page-viewer-sRHeV-5x.cjs} +1 -1
- package/dist/{page-viewer-OopsJHBE.js → page-viewer-wTIqXVBZ.js} +3 -3
- package/dist/{project-general-setting-n8KKf8qD.js → project-general-setting-Zirq3OGL.js} +3 -3
- package/dist/{project-general-setting-3sdmeYrS.cjs → project-general-setting-rrNhfejo.cjs} +1 -1
- package/dist/{project-seo-setting-pu3qUSE0.js → project-seo-setting-fqUbfFgl.js} +2 -2
- package/dist/{project-seo-setting-E554FQ3V.cjs → project-seo-setting-x_PDTJdV.cjs} +1 -1
- package/dist/{single-page-detail-hcTkta3X.js → single-page-detail-FqZ4Sp-y.js} +4 -4
- package/dist/{single-page-detail-KdxEu4WS.cjs → single-page-detail-dGVJrIFh.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +19 -3
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useCanvasSettings-6lwRwexD.js → useCanvasSettings-8RCa8BYU.js} +1 -1
- package/dist/{useCanvasSettings-oERGzYXb.cjs → useCanvasSettings-WJiLFik5.cjs} +1 -1
- package/package.json +4 -4
- package/dist/SidePanels-Vfw9Ir6p.cjs +0 -1
- package/dist/UILibrariesPanel-Igx0R4zc.js +0 -138
- package/dist/UILibrariesPanel-N144UO0E.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { KeyboardIcon as
|
|
3
|
-
import f, { useState as h, useEffect as
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { filter as
|
|
6
|
-
import { Z as
|
|
7
|
-
import { ListTreeIcon as
|
|
8
|
-
import { getChaiDataProviders as
|
|
9
|
-
import { useTranslation as
|
|
10
|
-
import { J as
|
|
2
|
+
import { KeyboardIcon as J, PlusIcon as K, Component2Icon as Z } from "@radix-ui/react-icons";
|
|
3
|
+
import f, { useState as h, useEffect as W, useMemo as Y, memo as $, lazy as j, Suspense as N } from "react";
|
|
4
|
+
import { useAtom as O } from "jotai";
|
|
5
|
+
import { filter as y, map as E, isNull as q, find as G, isEmpty as Q, each as X, get as ee } from "lodash-es";
|
|
6
|
+
import { Z as H, _ as U, $ as F, a0 as R, a1 as se, a2 as re, A as ae, a as le, b as ie, c as te, d as oe, e as ne, f as ce, g as de, a3 as me, a4 as xe, a5 as he, a6 as ue, a7 as pe, a8 as fe, a9 as je, aa as z, ab as ve, ac as ge, ad as be, ae as Ne, af as B, h as w, ag as ye, B as x, ah as L, ai as V, aj as I, ak as T, al as _ } from "./ChaiBuilderEditor-3Wj_t3jA.js";
|
|
7
|
+
import { ListTreeIcon as A, PaletteIcon as we, DatabaseIcon as ke } from "lucide-react";
|
|
8
|
+
import { getChaiDataProviders as Ce } from "@chaibuilder/runtime";
|
|
9
|
+
import { useTranslation as v } from "react-i18next";
|
|
10
|
+
import { J as De, a as Te, d as _e } from "./index-e0c8PmRQ.js";
|
|
11
11
|
import { O as i } from "./STRINGS--j49GZJP.js";
|
|
12
|
-
import { c as
|
|
12
|
+
import { c as Ae } from "./Functions-7jnEwJyw.js";
|
|
13
13
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
14
|
import "clsx";
|
|
15
15
|
import "react-dom";
|
|
@@ -43,26 +43,26 @@ import "@radix-ui/react-context-menu";
|
|
|
43
43
|
import "react-icons-picker";
|
|
44
44
|
import "react-quill";
|
|
45
45
|
import "react-hotkeys-hook";
|
|
46
|
-
const
|
|
47
|
-
const { t: a } =
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
/* @__PURE__ */ e.jsxs(
|
|
52
|
-
/* @__PURE__ */ e.jsxs(
|
|
46
|
+
const Pe = ({ provider: r, onClose: t }) => {
|
|
47
|
+
const { t: a } = v(), [l, u] = h(null);
|
|
48
|
+
return W(() => {
|
|
49
|
+
r && (r.mockFn ? r.mockFn : r.dataFn)().then((c) => u(c));
|
|
50
|
+
}, [r]), r ? /* @__PURE__ */ e.jsx(H, { onOpenChange: (d) => d ? "" : t(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(U, { children: [
|
|
51
|
+
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
52
|
+
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
53
53
|
a("data_provider"),
|
|
54
54
|
": ",
|
|
55
|
-
|
|
55
|
+
r.name
|
|
56
56
|
] }),
|
|
57
|
-
/* @__PURE__ */ e.jsx(
|
|
57
|
+
/* @__PURE__ */ e.jsx(se, { children: r.description })
|
|
58
58
|
] }),
|
|
59
|
-
/* @__PURE__ */ e.jsx(
|
|
60
|
-
|
|
59
|
+
/* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsx(
|
|
60
|
+
De,
|
|
61
61
|
{
|
|
62
62
|
data: l,
|
|
63
|
-
shouldExpandNode:
|
|
63
|
+
shouldExpandNode: Te,
|
|
64
64
|
style: {
|
|
65
|
-
...
|
|
65
|
+
..._e,
|
|
66
66
|
container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
67
67
|
stringValue: "text-orange-600",
|
|
68
68
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -71,78 +71,78 @@ const Ie = ({ provider: s, onClose: o }) => {
|
|
|
71
71
|
) })
|
|
72
72
|
] }) }) : null;
|
|
73
73
|
};
|
|
74
|
-
function
|
|
75
|
-
children:
|
|
76
|
-
name:
|
|
74
|
+
function Se({
|
|
75
|
+
children: r,
|
|
76
|
+
name: t,
|
|
77
77
|
onRemove: a
|
|
78
78
|
}) {
|
|
79
|
-
const { t: l } =
|
|
80
|
-
return /* @__PURE__ */ e.jsxs(
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
82
|
-
/* @__PURE__ */ e.jsxs(
|
|
83
|
-
/* @__PURE__ */ e.jsxs(
|
|
79
|
+
const { t: l } = v();
|
|
80
|
+
return /* @__PURE__ */ e.jsxs(ae, { children: [
|
|
81
|
+
/* @__PURE__ */ e.jsx(le, { asChild: !0, children: r }),
|
|
82
|
+
/* @__PURE__ */ e.jsxs(ie, { children: [
|
|
83
|
+
/* @__PURE__ */ e.jsxs(te, { children: [
|
|
84
84
|
/* @__PURE__ */ e.jsx(
|
|
85
|
-
|
|
85
|
+
oe,
|
|
86
86
|
{
|
|
87
|
-
dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}",
|
|
87
|
+
dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", t) }
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
/* @__PURE__ */ e.jsx(
|
|
90
|
+
/* @__PURE__ */ e.jsx(ne, { children: l("remove_provider_warning") })
|
|
91
91
|
] }),
|
|
92
|
-
/* @__PURE__ */ e.jsxs(
|
|
93
|
-
/* @__PURE__ */ e.jsx(
|
|
94
|
-
/* @__PURE__ */ e.jsx(
|
|
92
|
+
/* @__PURE__ */ e.jsxs(ce, { children: [
|
|
93
|
+
/* @__PURE__ */ e.jsx(de, { children: l("cancel") }),
|
|
94
|
+
/* @__PURE__ */ e.jsx(me, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
|
|
95
95
|
] })
|
|
96
96
|
] })
|
|
97
97
|
] });
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
const { t:
|
|
101
|
-
|
|
102
|
-
), [
|
|
103
|
-
|
|
104
|
-
(
|
|
105
|
-
),
|
|
106
|
-
const
|
|
107
|
-
c((
|
|
108
|
-
},
|
|
109
|
-
c((
|
|
110
|
-
},
|
|
111
|
-
return
|
|
112
|
-
|
|
99
|
+
const Ke = () => {
|
|
100
|
+
const { t: r } = v(), t = Y(() => Ce(), []), [a, l] = xe(), [, u] = O(he), [d, c] = h(
|
|
101
|
+
y(t, (s) => E(a, "providerKey").includes(s.providerKey))
|
|
102
|
+
), [k, p] = h(""), [S, g] = h(null), b = y(
|
|
103
|
+
t.map((s) => E(d, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
104
|
+
(s) => !q(s)
|
|
105
|
+
), o = (s) => {
|
|
106
|
+
const n = G(t, { providerKey: s });
|
|
107
|
+
c((m) => [...m, n]), l((m) => [...m, { providerKey: n.providerKey, args: {} }]), p(""), u("UNSAVED");
|
|
108
|
+
}, C = (s) => {
|
|
109
|
+
c((n) => y(n, (m) => m.providerKey !== s.providerKey)), l((n) => y(n, (m) => m.providerKey !== s.providerKey)), u("UNSAVED");
|
|
110
|
+
}, D = (s) => g(s);
|
|
111
|
+
return Q(t) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
112
|
+
r("no_data_providers"),
|
|
113
113
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
114
|
-
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children:
|
|
114
|
+
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: r("learn_more") })
|
|
115
115
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
116
116
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
117
|
-
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children:
|
|
118
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
119
|
-
/* @__PURE__ */ e.jsx(
|
|
120
|
-
/* @__PURE__ */ e.jsxs(
|
|
121
|
-
/* @__PURE__ */ e.jsx(
|
|
122
|
-
|
|
117
|
+
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: r("add_data_providers") }) }),
|
|
118
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ue, { value: k, onValueChange: (s) => o(s), children: [
|
|
119
|
+
/* @__PURE__ */ e.jsx(pe, { className: "w-full", children: /* @__PURE__ */ e.jsx(fe, { placeholder: r("select_provider") }) }),
|
|
120
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
121
|
+
/* @__PURE__ */ e.jsx(z, { value: "", children: r("choose") }),
|
|
122
|
+
b.map((s) => /* @__PURE__ */ e.jsx(z, { value: s.value, children: s.label }, s.value))
|
|
123
123
|
] })
|
|
124
124
|
] }) }),
|
|
125
125
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
126
|
-
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${
|
|
126
|
+
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${d.length ? "block" : "hidden"}`, children: [
|
|
127
127
|
/* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
|
|
128
|
-
|
|
128
|
+
r("page_data_providers"),
|
|
129
129
|
":"
|
|
130
130
|
] }),
|
|
131
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children:
|
|
131
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: d.map((s) => /* @__PURE__ */ e.jsxs(
|
|
132
132
|
"div",
|
|
133
133
|
{
|
|
134
134
|
className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
135
135
|
"data-v0-t": "card",
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-1.5 px-4 pt-4", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
138
|
-
/* @__PURE__ */ e.jsx("h3", { className: "font-medium leading-4", children:
|
|
139
|
-
/* @__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 })
|
|
140
140
|
] }) }) }),
|
|
141
141
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-2 py-2", children: [
|
|
142
142
|
/* @__PURE__ */ e.jsxs(
|
|
143
143
|
"button",
|
|
144
144
|
{
|
|
145
|
-
onClick: () =>
|
|
145
|
+
onClick: () => D(s),
|
|
146
146
|
className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -164,11 +164,11 @@ const Ve = () => {
|
|
|
164
164
|
]
|
|
165
165
|
}
|
|
166
166
|
),
|
|
167
|
-
|
|
167
|
+
r("view_data")
|
|
168
168
|
]
|
|
169
169
|
}
|
|
170
170
|
),
|
|
171
|
-
/* @__PURE__ */ e.jsx(
|
|
171
|
+
/* @__PURE__ */ e.jsx(Se, { onRemove: () => C(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
|
|
172
172
|
/* @__PURE__ */ e.jsxs(
|
|
173
173
|
"svg",
|
|
174
174
|
{
|
|
@@ -189,18 +189,18 @@ const Ve = () => {
|
|
|
189
189
|
]
|
|
190
190
|
}
|
|
191
191
|
),
|
|
192
|
-
|
|
192
|
+
r("remove")
|
|
193
193
|
] }) })
|
|
194
194
|
] })
|
|
195
195
|
]
|
|
196
196
|
},
|
|
197
|
-
|
|
197
|
+
s.providerKey
|
|
198
198
|
)) }),
|
|
199
|
-
/* @__PURE__ */ e.jsx(
|
|
199
|
+
/* @__PURE__ */ e.jsx(Pe, { onClose: () => g(null), provider: S })
|
|
200
200
|
] })
|
|
201
201
|
] });
|
|
202
|
-
},
|
|
203
|
-
const { t:
|
|
202
|
+
}, Ee = $(() => {
|
|
203
|
+
const { t: r } = v(), t = {
|
|
204
204
|
"ctrl + Z": "Undo",
|
|
205
205
|
"ctrl + Y": "Redo",
|
|
206
206
|
"ctrl + D": "Duplicate"
|
|
@@ -210,121 +210,121 @@ const Ve = () => {
|
|
|
210
210
|
esc: "Deselect blocks",
|
|
211
211
|
del: "Delete block"
|
|
212
212
|
};
|
|
213
|
-
return /* @__PURE__ */ e.jsxs(
|
|
214
|
-
/* @__PURE__ */ e.jsx(
|
|
215
|
-
/* @__PURE__ */ e.jsx(
|
|
216
|
-
/* @__PURE__ */ e.jsx(
|
|
213
|
+
return /* @__PURE__ */ e.jsxs(H, { children: [
|
|
214
|
+
/* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsxs(ge, { children: [
|
|
215
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(J, {}) }) }),
|
|
216
|
+
/* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsx("p", { children: r("Keyboard shortcuts") }) })
|
|
217
217
|
] }) }),
|
|
218
|
-
/* @__PURE__ */ e.jsxs(
|
|
219
|
-
/* @__PURE__ */ e.jsx(
|
|
218
|
+
/* @__PURE__ */ e.jsxs(U, { className: "sm:max-w-[525px]", children: [
|
|
219
|
+
/* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(R, { children: r("Keyboard shortcuts") }) }),
|
|
220
220
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
|
|
221
|
-
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(
|
|
222
|
-
/* @__PURE__ */ e.jsx(
|
|
223
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
221
|
+
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(t).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
222
|
+
/* @__PURE__ */ e.jsx(B, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: r(l) }),
|
|
223
|
+
/* @__PURE__ */ e.jsx("div", { children: r(t[l]) })
|
|
224
224
|
] }, l)) }),
|
|
225
225
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(a).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
226
|
-
/* @__PURE__ */ e.jsx(
|
|
227
|
-
/* @__PURE__ */ e.jsx("div", { 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
228
|
] }, l)) })
|
|
229
229
|
] }) })
|
|
230
230
|
] })
|
|
231
231
|
] });
|
|
232
|
-
}),
|
|
233
|
-
let
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
"add-blocks":
|
|
237
|
-
[i]:
|
|
238
|
-
"theme-configuration":
|
|
239
|
-
images:
|
|
240
|
-
"ui-libraries":
|
|
232
|
+
}), ze = j(() => import("./AddBlocks-axw0eS0q.js")), P = j(() => import("./ListTree-hYx4RLqK.js")), Be = j(() => import("./ThemeConfiguration-5lCjeQNl.js")), Le = j(() => import("./ChaiBuilderEditor-3Wj_t3jA.js").then((r) => r.co)), Ve = j(() => import("./UILibrariesPanel-p5kL4hPY.js"));
|
|
233
|
+
let M = null;
|
|
234
|
+
const As = () => {
|
|
235
|
+
const r = w("sideBarComponents.top", []), t = w("sideBarComponents.bottom", []), [a, l] = O(ye), [u, d] = h(a), [c, k] = h(null), { t: p } = v(), g = w("uiLibraries", []).length > 0, b = {
|
|
236
|
+
"add-blocks": ze,
|
|
237
|
+
[i]: P,
|
|
238
|
+
"theme-configuration": Be,
|
|
239
|
+
images: Le,
|
|
240
|
+
"ui-libraries": Ve
|
|
241
241
|
};
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
X(r, ({ name: s, panel: n }) => {
|
|
243
|
+
b[s] = n;
|
|
244
244
|
});
|
|
245
|
-
const
|
|
246
|
-
clearTimeout(
|
|
247
|
-
},
|
|
248
|
-
function
|
|
249
|
-
const
|
|
250
|
-
c && (
|
|
245
|
+
const o = (s) => {
|
|
246
|
+
clearTimeout(M), a !== i && s === i ? M = setTimeout(() => l(i), 500) : d(s), l(s);
|
|
247
|
+
}, C = w("dataBindingSupport", !1);
|
|
248
|
+
function D() {
|
|
249
|
+
const s = setTimeout(() => {
|
|
250
|
+
c && (o(i), clearTimeout(c));
|
|
251
251
|
}, 500);
|
|
252
|
-
|
|
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
|
-
|
|
265
|
+
g ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 rounded-md bg-gray-200 p-1", children: [
|
|
266
266
|
/* @__PURE__ */ e.jsx(
|
|
267
267
|
x,
|
|
268
268
|
{
|
|
269
|
-
onClick: () =>
|
|
269
|
+
onClick: () => o("add-blocks"),
|
|
270
270
|
size: "sm",
|
|
271
271
|
variant: a === "add-blocks" ? "default" : "outline",
|
|
272
|
-
children: /* @__PURE__ */ e.jsx(
|
|
272
|
+
children: /* @__PURE__ */ e.jsx(K, { className: "text-xl" })
|
|
273
273
|
}
|
|
274
274
|
),
|
|
275
275
|
/* @__PURE__ */ e.jsx(
|
|
276
276
|
x,
|
|
277
277
|
{
|
|
278
|
-
onClick: () =>
|
|
278
|
+
onClick: () => o("ui-libraries"),
|
|
279
279
|
size: "sm",
|
|
280
280
|
variant: a === "ui-libraries" ? "default" : "outline",
|
|
281
|
-
children: /* @__PURE__ */ e.jsx(
|
|
281
|
+
children: /* @__PURE__ */ e.jsx(Z, { className: "text-xl" })
|
|
282
282
|
}
|
|
283
283
|
)
|
|
284
284
|
] }) : /* @__PURE__ */ e.jsx(
|
|
285
285
|
x,
|
|
286
286
|
{
|
|
287
|
-
onClick: () =>
|
|
287
|
+
onClick: () => o("add-blocks"),
|
|
288
288
|
size: "sm",
|
|
289
289
|
variant: a === "add-blocks" ? "default" : "outline",
|
|
290
|
-
children: /* @__PURE__ */ e.jsx(
|
|
290
|
+
children: /* @__PURE__ */ e.jsx(K, { className: "text-xl" })
|
|
291
291
|
}
|
|
292
292
|
),
|
|
293
293
|
/* @__PURE__ */ e.jsx(
|
|
294
294
|
x,
|
|
295
295
|
{
|
|
296
|
-
onClick: () =>
|
|
296
|
+
onClick: () => o(i),
|
|
297
297
|
size: "sm",
|
|
298
298
|
variant: a === i ? "default" : "outline",
|
|
299
|
-
children: /* @__PURE__ */ e.jsx(
|
|
299
|
+
children: /* @__PURE__ */ e.jsx(A, { className: "w-4" })
|
|
300
300
|
}
|
|
301
301
|
),
|
|
302
302
|
/* @__PURE__ */ e.jsx(
|
|
303
303
|
x,
|
|
304
304
|
{
|
|
305
|
-
onClick: () =>
|
|
305
|
+
onClick: () => o("theme-configuration"),
|
|
306
306
|
size: "sm",
|
|
307
307
|
variant: a === "theme-configuration" ? "default" : "outline",
|
|
308
|
-
children: /* @__PURE__ */ e.jsx(
|
|
308
|
+
children: /* @__PURE__ */ e.jsx(we, { className: "w-4 max-w-[40px] text-xs" })
|
|
309
309
|
}
|
|
310
310
|
),
|
|
311
311
|
f.Children.toArray(
|
|
312
|
-
|
|
312
|
+
r.map(({ name: s, icon: n }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(L, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
313
313
|
x,
|
|
314
314
|
{
|
|
315
|
-
onClick: () =>
|
|
315
|
+
onClick: () => o(s),
|
|
316
316
|
size: "sm",
|
|
317
317
|
className: "w-10",
|
|
318
|
-
variant: a ===
|
|
319
|
-
children: /* @__PURE__ */ e.jsx(
|
|
318
|
+
variant: a === s ? "default" : "outline",
|
|
319
|
+
children: /* @__PURE__ */ e.jsx(n, {})
|
|
320
320
|
}
|
|
321
321
|
) }))
|
|
322
322
|
)
|
|
323
323
|
] }),
|
|
324
324
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
325
|
-
/* @__PURE__ */ e.jsx(
|
|
325
|
+
/* @__PURE__ */ e.jsx(Ee, {}),
|
|
326
326
|
f.Children.toArray(
|
|
327
|
-
|
|
327
|
+
t.map((s) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(L, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(s, {}) }))
|
|
328
328
|
)
|
|
329
329
|
] })
|
|
330
330
|
] }),
|
|
@@ -343,13 +343,13 @@ const zs = () => {
|
|
|
343
343
|
children: /* @__PURE__ */ e.jsx(
|
|
344
344
|
"div",
|
|
345
345
|
{
|
|
346
|
-
className:
|
|
346
|
+
className: Ae(
|
|
347
347
|
"relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"
|
|
348
348
|
),
|
|
349
349
|
onMouseEnter: () => {
|
|
350
350
|
c && clearTimeout(c);
|
|
351
351
|
},
|
|
352
|
-
children: f.createElement(
|
|
352
|
+
children: f.createElement(ee(b, a, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
353
353
|
}
|
|
354
354
|
)
|
|
355
355
|
}
|
|
@@ -364,32 +364,32 @@ const zs = () => {
|
|
|
364
364
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
365
365
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
366
366
|
] }),
|
|
367
|
-
children:
|
|
368
|
-
/* @__PURE__ */ e.jsxs(
|
|
369
|
-
/* @__PURE__ */ e.jsxs(
|
|
370
|
-
/* @__PURE__ */ e.jsx(
|
|
367
|
+
children: C ? /* @__PURE__ */ e.jsxs(V, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
368
|
+
/* @__PURE__ */ e.jsxs(I, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
369
|
+
/* @__PURE__ */ e.jsxs(T, { value: i, children: [
|
|
370
|
+
/* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
|
|
371
371
|
" ",
|
|
372
372
|
p("Outline")
|
|
373
373
|
] }),
|
|
374
|
-
/* @__PURE__ */ e.jsxs(
|
|
375
|
-
/* @__PURE__ */ e.jsx(
|
|
374
|
+
/* @__PURE__ */ e.jsxs(T, { value: "data-provider", children: [
|
|
375
|
+
/* @__PURE__ */ e.jsx(ke, { className: "mr-2 w-3" }),
|
|
376
376
|
p("Data")
|
|
377
377
|
] })
|
|
378
378
|
] }),
|
|
379
|
-
/* @__PURE__ */ e.jsx(
|
|
380
|
-
/* @__PURE__ */ e.jsx(
|
|
381
|
-
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
382
|
-
/* @__PURE__ */ e.jsx(
|
|
383
|
-
/* @__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" }),
|
|
384
384
|
" ",
|
|
385
385
|
p("Outline")
|
|
386
386
|
] }) }),
|
|
387
387
|
/* @__PURE__ */ e.jsx(
|
|
388
|
-
|
|
388
|
+
_,
|
|
389
389
|
{
|
|
390
390
|
value: i,
|
|
391
391
|
className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
392
|
-
children: f.createElement(
|
|
392
|
+
children: f.createElement(P)
|
|
393
393
|
}
|
|
394
394
|
)
|
|
395
395
|
] }) })
|
|
@@ -398,5 +398,5 @@ const zs = () => {
|
|
|
398
398
|
] });
|
|
399
399
|
};
|
|
400
400
|
export {
|
|
401
|
-
|
|
401
|
+
As as default
|
|
402
402
|
};
|
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import j from "@rjsf/validator-ajv8";
|
|
4
4
|
import k from "@rjsf/core";
|
|
5
|
-
import { h as M, F as T, bv as w } from "./ChaiBuilderEditor-
|
|
5
|
+
import { h as M, F as T, bv as w } from "./ChaiBuilderEditor-3Wj_t3jA.js";
|
|
6
6
|
import { y as f, c as D, f as a } from "./controls-VTdJhdSz.js";
|
|
7
7
|
import { debounce as P, noop as R, isEqual as F } from "lodash-es";
|
|
8
8
|
import { useTranslation as L } from "react-i18next";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),R=require("react"),N=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),R=require("react"),N=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./ChaiBuilderEditor-syigvGWW.cjs"),r=require("./controls-jWJDao88.cjs"),f=require("lodash-es"),k=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");function M(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const m=M(R),P=({value:t,onChange:e,id:i,onBlur:l})=>{const n=f.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},x=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"},{title:"Bebas Neue",value:"Bebas Neue"},{title:"Manrope",value:"Manrope"}],T=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",f.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=m.useRef(e),{t:v}=k.useTranslation();m.useEffect(()=>()=>{f.isEqual(e,n.current)||t(n.current)},[]);const u=({formData:o},d)=>{d&&(i(o),n.current=o)},{bodyFont:q,headingFont:b,primaryColor:h,bodyTextDarkColor:y,bodyTextLightColor:C,bodyBgDarkColor:S,secondaryColor:j,bodyBgLightColor:O,roundedCorners:B}=e;let s={headingFont:r.y({title:"Heading font",default:b,options:x}),bodyFont:r.y({title:"Body font",default:q,options:x}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(B||5,10)}),primaryColor:r.f({title:"Primary",default:h}),secondaryColor:r.f({title:"Secondary",default:j})};l||(s={...s,bodyBgLightColor:r.f({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.f({title:"Body Text (Light Mode)",default:y}),bodyBgDarkColor:r.f({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.f({title:"Body Text (Dark mode)",default:C})});const c={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const d=s[o];return c.properties||(c.properties={}),c.properties[o]=d.schema,g[o]=d.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:v("Theme Configuration")})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:P},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:c,formData:e,validator:N,onChange:u})})]})};exports.default=T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import o, { useMemo as h, Suspense as c } from "react";
|
|
3
3
|
import { FontFamilyIcon as j, EyeOpenIcon as g } from "@radix-ui/react-icons";
|
|
4
|
-
import { h as r, a6 as f, a7 as v, a8 as b, a9 as N, am as S, an as w, aa as l, V as y, B as p, ao as C, E as B, ah as m, ap as A } from "./ChaiBuilderEditor-
|
|
4
|
+
import { h as r, a6 as f, a7 as v, a8 as b, a9 as N, am as S, an as w, aa as l, V as y, B as p, ao as C, E as B, ah as m, ap as A } from "./ChaiBuilderEditor-3Wj_t3jA.js";
|
|
5
5
|
import { useTranslation as x } from "react-i18next";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "clsx";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),a=require("@radix-ui/react-icons"),r=require("./ChaiBuilderEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),a=require("@radix-ui/react-icons"),r=require("./ChaiBuilderEditor-syigvGWW.cjs"),l=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");const p=()=>r.useBuilderProp("languages",["en"]),m=()=>p().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(a.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),j=()=>{const{savePage:u,saveState:s}=r.useSavePage(),{t:i}=l.useTranslation(),x=r.useBuilderProp("hideSaveButton",!1),t=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[s]);if(x)return null;const o=e.jsxRuntimeExports.jsxs(r.Button,{disabled:s==="SAVING",onClick:c=>{c.preventDefault(),u()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${t}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(r.FaCircleCheck,{className:"text-lg"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:s==="SAVING"?"Saving...":i(s==="SAVED"?"Saved":"Unsaved")})]});return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:o})},d=function(){const s=r.useBuilderProp("previewComponent"),[,i]=r.usePreviewMode(),{t:x}=l.useTranslation();return s?e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx(a.EyeOpenIcon,{className:"text-xs"}),e.jsxRuntimeExports.jsx("span",{className:"text-sm",children:x("Preview")})]}):null},h=()=>{const u=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),i=r.useBuilderProp("topBarComponents.right",[]),x=r.useBuilderProp("editable",!0);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:n.Children.toArray(u.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:n.Children.toArray(s.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(m,{}),e.jsxRuntimeExports.jsx(d,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),x?e.jsxRuntimeExports.jsx(j,{}):null,n.Children.toArray(i.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("lodash-es"),t=require("react"),n=require("./ChaiBuilderEditor-syigvGWW.cjs"),E=require("@chaibuilder/runtime"),R=require("lucide-react"),b=require("jotai"),y=require("./Functions-N3yhPYKY.cjs"),v=require("@radix-ui/react-icons"),w=require("./STRINGS-gPz7CUOk.cjs"),q=require("lodash"),k=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("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 B=({block:r,closePopover:o,library:u})=>{const[a,d]=t.useState(!1),l=n.useBuilderProp("getUILibraryBlock",i.noop),{addCoreBlock:c,addPredefinedBlock:p}=n.useAddBlock(),[j]=n.useSelectedBlockIds(),h=t.useCallback(async f=>{if(f.stopPropagation(),i.has(r,"component")){c(r,i.first(j)),o();return}d(!0);const s=await l(u,r);i.isEmpty(s)||p(E.syncBlocksWithDefaults(s),i.first(j)),o()},[r]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{onClick:a?()=>{}:h,className:"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:[a&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black/70",children:[e.jsxRuntimeExports.jsx(R.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[25px] w-full rounded-md",alt:r.name}):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:r.name})})]})})},N=r=>{const o=n.useBuilderProp("getUILibraryBlocks",i.noop),[u,a]=t.useState([]),[d,l]=t.useState(!1);return t.useEffect(()=>{(async()=>{if(!r)return;l(!0);const c=await o(r);a(c),l(!1)})()},[]),{data:u,isLoading:d}},L=b.atom(""),I=()=>{const[r]=b.useAtom(L),o=n.useBuilderProp("uiLibraries",[]),u=o.find(x=>x.uuid===r)||i.first(o),{data:a,isLoading:d}=N(u),l=q.groupBy(a,"group"),[c,p]=t.useState("Hero"),[,j]=b.useAtom(n.activePanelAtom),h=i.get(l,c,[]),{t:f}=k.useTranslation(),s=t.useRef(null),g=x=>{s.current&&(clearTimeout(s.current),s.current=null),s.current=setTimeout(()=>{s.current&&p(x)},300)};return d?e.jsxRuntimeExports.jsx(n.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:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex h-fit flex-col",children:e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsxs("h1",{className:"flex w-full flex-col items-baseline truncate px-1 text-sm font-semibold xl:flex-col",children:[f("Library"),": ",u.name]}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-[9px] font-light leading-3 opacity-80 xl:pl-1",children:f("Click to add blocks to page")})]})}),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:t.Children.toArray(q.map(l,(x,m)=>e.jsxRuntimeExports.jsxs("div",{onMouseEnter:()=>g(m),onMouseLeave:()=>clearTimeout(s.current),onClick:()=>p(m),className:y.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",m===c?"bg-blue-500 text-white hover:bg-blue-600":""),children:[e.jsxRuntimeExports.jsx("span",{children:m}),e.jsxRuntimeExports.jsx(v.CaretRightIcon,{className:"ml-2 h-5 w-5"})]},m)))}),e.jsxRuntimeExports.jsxs(n.ScrollArea,{onMouseEnter:()=>s.current?clearTimeout(s.current):null,className:"z-10 -mt-2 flex h-full max-h-full w-[300px] flex-col gap-2 border-l border-gray-300 px-2 transition-all ease-linear",children:[t.Children.toArray(h.map(x=>e.jsxRuntimeExports.jsx(B,{block:x,library:u,closePopover:()=>j(w.OUTLINE_KEY)}))),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("br",{})]})]})]})})},A=()=>e.jsxRuntimeExports.jsx(I,{});exports.default=A;
|