@chaibuilder/sdk 1.2.13 → 1.2.15
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-zN5--UP6.js → AddBlocks-IE14csoo.js} +63 -57
- package/dist/{AddBlocks-tomDo_Is.cjs → AddBlocks-OpGQyVQZ.cjs} +1 -1
- package/dist/{BrandingOptions-BUmE4f72.cjs → BrandingOptions-tBWzqas5.cjs} +1 -1
- package/dist/{BrandingOptions-LbizrmRI.js → BrandingOptions-t_MjeHSM.js} +1 -1
- package/dist/{CanvasArea-nT6ZJh_V.cjs → CanvasArea-SBeW-Kdq.cjs} +4 -4
- package/dist/{CanvasArea-OSH8wqt1.js → CanvasArea-TR5t1xxh.js} +3 -3
- package/dist/{CurrentPage-SWR9WU4k.cjs → CurrentPage--ag-4O2R.cjs} +1 -1
- package/dist/{CurrentPage-FzqNBLy4.js → CurrentPage-JUlhyVbI.js} +2 -2
- package/dist/{Layers-FRHRlPIH.cjs → Layers-05Ut4xZA.cjs} +1 -1
- package/dist/{Layers-g5_pwwgO.js → Layers-Dav1kBNN.js} +125 -148
- package/dist/{PagesPanel-PSg6aqlK.js → PagesPanel--feFCDeH.js} +3 -3
- package/dist/{PagesPanel-3jcf5-iH.cjs → PagesPanel-TLVCJtcF.cjs} +1 -1
- package/dist/{ProjectPanel-XW_Bx880.js → ProjectPanel--Vq6HSMl.js} +3 -3
- package/dist/{ProjectPanel-EyEcNyh8.cjs → ProjectPanel-Q8sNFs1f.cjs} +1 -1
- package/dist/{Settings-h1c8ukpI.cjs → Settings-9iryF0yE.cjs} +1 -1
- package/dist/{Settings--7qJ7ciF.js → Settings-DjE6HR2E.js} +2 -2
- package/dist/{SidePanels-Lmj0Qkd1.js → SidePanels-4zpCzCM6.js} +68 -68
- package/dist/{SidePanels-NbM1mfsY.cjs → SidePanels-LVED6uuT.cjs} +1 -1
- package/dist/{Topbar-2sOsQD2d.cjs → Topbar-iH2L4pe0.cjs} +1 -1
- package/dist/{Topbar-xvrno03z.js → Topbar-ryFhl-PC.js} +1 -1
- package/dist/{UnsplashImages-EiYSWkBa.cjs → UnsplashImages-SrxA-yNu.cjs} +1 -1
- package/dist/{UnsplashImages-hhPOf7kt.js → UnsplashImages-ppQXZ28F.js} +1 -1
- package/dist/{UploadImages-JKjE44i7.js → UploadImages-IKR4oX2k.js} +1 -1
- package/dist/{UploadImages-GGCExfQd.cjs → UploadImages-VBiO6lqp.cjs} +1 -1
- package/dist/{add-page-modal-65wltt_4.cjs → add-page-modal-KixvLXAG.cjs} +1 -1
- package/dist/{add-page-modal-Bl6y65im.js → add-page-modal-nZJaunuz.js} +3 -3
- package/dist/{confirm-alert-Nw1JCtuu.js → confirm-alert-QKtbNbWz.js} +1 -1
- package/dist/{confirm-alert-_DCO6hCV.cjs → confirm-alert-uV_PtYc3.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/{delete-page-modal-Q3Si4nyd.cjs → delete-page-modal-6GxLQkEk.cjs} +1 -1
- package/dist/{delete-page-modal-tiJ2UA5f.js → delete-page-modal-pN5cFz-m.js} +2 -2
- package/dist/email.cjs +1 -1
- package/dist/email.js +2 -2
- package/dist/{form-vNgf0kO2.cjs → form-KkP1F7h1.cjs} +1 -1
- package/dist/{form-lbFCPUoE.js → form-faX0Yn4Q.js} +1 -1
- package/dist/{index-bfKqnRvZ.cjs → index-ERorPL9q.cjs} +1 -1
- package/dist/{index-m9VziIOy.js → index-QGA4ayU7.js} +275 -275
- package/dist/{index-wwk4px_E.js → index-nrRnwUaC.js} +665 -660
- package/dist/{index-hS9T9Nub.cjs → index-xJ8LmB04.cjs} +22 -22
- package/dist/{page-viewer-w-ahza8q.cjs → page-viewer-Nn__90Uo.cjs} +1 -1
- package/dist/{page-viewer-rLCyM4QC.js → page-viewer-U7o88VvR.js} +3 -3
- package/dist/{project-general-setting-RTcIwUWc.cjs → project-general-setting-C98_GooL.cjs} +1 -1
- package/dist/{project-general-setting-pY-Mkc8G.js → project-general-setting-h0TeKYRf.js} +3 -3
- package/dist/{project-seo-setting-aRDdqu88.cjs → project-seo-setting-8oJUrOqk.cjs} +1 -1
- package/dist/{project-seo-setting-9V67NFil.js → project-seo-setting-Sl6AE-Q7.js} +2 -2
- package/dist/{single-page-detail-wHDpn40R.cjs → single-page-detail-RYI1ukX6.cjs} +1 -1
- package/dist/{single-page-detail-HYX4R3U0.js → single-page-detail-a8zY-XHs.js} +4 -4
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +110 -2
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/{useAddBlockByDrop-1WvPoBXa.cjs → useAddBlockByDrop-LBgi6GL7.cjs} +1 -1
- package/dist/{useAddBlockByDrop-bs_SH7Tw.js → useAddBlockByDrop-Y-g4O8UC.js} +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { PlusIcon as
|
|
3
|
-
import h, { useState as x, useEffect as
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { filter as g, map as
|
|
6
|
-
import { ad as
|
|
7
|
-
import { ListTreeIcon as
|
|
2
|
+
import { PlusIcon as H, Half2Icon as I } from "@radix-ui/react-icons";
|
|
3
|
+
import h, { useState as x, useEffect as L, useMemo as F, lazy as y, Suspense as j } from "react";
|
|
4
|
+
import { useAtom as V } from "jotai";
|
|
5
|
+
import { filter as g, map as S, isNull as R, find as q, isEmpty as J, each as O, get as U } from "lodash-es";
|
|
6
|
+
import { ad as $, ae as G, af as Z, ag as Q, ah as W, A as X, z as Y, C as ee, D as se, E as re, F as ae, G as le, H as ie, ai as te, o as oe, q as ne, aj as ce, ak as de, al as me, am as xe, an as T, i as k, ao as pe, B as b, S as E, ap as K, aq as z, ar as C, as as D } from "./index-QGA4ayU7.js";
|
|
7
|
+
import { ListTreeIcon as A, DatabaseIcon as ue } from "lucide-react";
|
|
8
8
|
import { getChaiDataProviders as he } from "@chaibuilder/runtime";
|
|
9
|
-
import { useTranslation as
|
|
9
|
+
import { useTranslation as P } from "react-i18next";
|
|
10
10
|
import { J as fe, a as ve, d as je } from "./index-e0c8PmRQ.js";
|
|
11
|
-
import { E as ge } from "./index-
|
|
11
|
+
import { E as ge } from "./index-nrRnwUaC.js";
|
|
12
12
|
import { c as be } from "./Functions-7jnEwJyw.js";
|
|
13
13
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
14
14
|
import "flat-to-nested";
|
|
@@ -52,23 +52,23 @@ import "./html-to-json-57841sEK.js";
|
|
|
52
52
|
import "himalaya";
|
|
53
53
|
import "./web-blocks.js";
|
|
54
54
|
import "./empty-slot-5FRrRq1E.js";
|
|
55
|
-
const ye = ({ provider: r, onClose:
|
|
56
|
-
const { t: a } =
|
|
57
|
-
return
|
|
55
|
+
const ye = ({ provider: r, onClose: t }) => {
|
|
56
|
+
const { t: a } = P(), [i, p] = x(null);
|
|
57
|
+
return L(() => {
|
|
58
58
|
r && (r.mockFn ? r.mockFn : r.dataFn)().then((o) => p(o));
|
|
59
|
-
}, [r]), r ? /* @__PURE__ */ e.jsx(
|
|
60
|
-
/* @__PURE__ */ e.jsxs(
|
|
61
|
-
/* @__PURE__ */ e.jsxs(
|
|
59
|
+
}, [r]), r ? /* @__PURE__ */ e.jsx($, { onOpenChange: (n) => n ? "" : t(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(G, { children: [
|
|
60
|
+
/* @__PURE__ */ e.jsxs(Z, { children: [
|
|
61
|
+
/* @__PURE__ */ e.jsxs(Q, { children: [
|
|
62
62
|
a("data_provider"),
|
|
63
63
|
": ",
|
|
64
64
|
r.name
|
|
65
65
|
] }),
|
|
66
|
-
/* @__PURE__ */ e.jsx(
|
|
66
|
+
/* @__PURE__ */ e.jsx(W, { children: r.description })
|
|
67
67
|
] }),
|
|
68
68
|
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx(
|
|
69
69
|
fe,
|
|
70
70
|
{
|
|
71
|
-
data:
|
|
71
|
+
data: i,
|
|
72
72
|
shouldExpandNode: ve,
|
|
73
73
|
style: {
|
|
74
74
|
...je,
|
|
@@ -82,53 +82,53 @@ const ye = ({ provider: r, onClose: i }) => {
|
|
|
82
82
|
};
|
|
83
83
|
function we({
|
|
84
84
|
children: r,
|
|
85
|
-
name:
|
|
85
|
+
name: t,
|
|
86
86
|
onRemove: a
|
|
87
87
|
}) {
|
|
88
|
-
const { t } =
|
|
89
|
-
return /* @__PURE__ */ e.jsxs(
|
|
90
|
-
/* @__PURE__ */ e.jsx(
|
|
91
|
-
/* @__PURE__ */ e.jsxs(
|
|
92
|
-
/* @__PURE__ */ e.jsxs(
|
|
88
|
+
const { t: i } = P();
|
|
89
|
+
return /* @__PURE__ */ e.jsxs(X, { children: [
|
|
90
|
+
/* @__PURE__ */ e.jsx(Y, { asChild: !0, children: r }),
|
|
91
|
+
/* @__PURE__ */ e.jsxs(ee, { children: [
|
|
92
|
+
/* @__PURE__ */ e.jsxs(se, { children: [
|
|
93
93
|
/* @__PURE__ */ e.jsx(
|
|
94
|
-
|
|
94
|
+
re,
|
|
95
95
|
{
|
|
96
|
-
dangerouslySetInnerHTML: { __html:
|
|
96
|
+
dangerouslySetInnerHTML: { __html: i("remove_provider_confirmation").replace("{name}", t) }
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
/* @__PURE__ */ e.jsx(
|
|
99
|
+
/* @__PURE__ */ e.jsx(ae, { children: i("remove_provider_warning") })
|
|
100
100
|
] }),
|
|
101
|
-
/* @__PURE__ */ e.jsxs(
|
|
102
|
-
/* @__PURE__ */ e.jsx(
|
|
103
|
-
/* @__PURE__ */ e.jsx(
|
|
101
|
+
/* @__PURE__ */ e.jsxs(le, { children: [
|
|
102
|
+
/* @__PURE__ */ e.jsx(ie, { children: i("cancel") }),
|
|
103
|
+
/* @__PURE__ */ e.jsx(te, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: i("remove") })
|
|
104
104
|
] })
|
|
105
105
|
] })
|
|
106
106
|
] });
|
|
107
107
|
}
|
|
108
108
|
const Ne = () => {
|
|
109
|
-
const { t: r } =
|
|
110
|
-
g(
|
|
109
|
+
const { t: r } = P(), t = F(() => he(), []), [a, i] = oe(), [, p] = V(ne), [n, o] = x(
|
|
110
|
+
g(t, (s) => S(a, "providerKey").includes(s.providerKey))
|
|
111
111
|
), [w, f] = x(""), [c, v] = x(null), N = g(
|
|
112
|
-
|
|
113
|
-
(s) => !
|
|
112
|
+
t.map((s) => S(n, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
113
|
+
(s) => !R(s)
|
|
114
114
|
), l = (s) => {
|
|
115
|
-
const m =
|
|
116
|
-
o((d) => [...d, m]),
|
|
115
|
+
const m = q(t, { providerKey: s });
|
|
116
|
+
o((d) => [...d, m]), i((d) => [...d, { providerKey: m.providerKey, args: {} }]), f(""), p("UNSAVED");
|
|
117
117
|
}, u = (s) => {
|
|
118
|
-
o((m) => g(m, (d) => d.providerKey !== s.providerKey)),
|
|
119
|
-
},
|
|
120
|
-
return
|
|
118
|
+
o((m) => g(m, (d) => d.providerKey !== s.providerKey)), i((m) => g(m, (d) => d.providerKey !== s.providerKey)), p("UNSAVED");
|
|
119
|
+
}, M = (s) => v(s);
|
|
120
|
+
return J(t) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
121
121
|
r("no_data_providers"),
|
|
122
122
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
123
123
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: r("learn_more") })
|
|
124
124
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
125
125
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
126
126
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: r("add_data_providers") }) }),
|
|
127
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
128
|
-
/* @__PURE__ */ e.jsx(
|
|
129
|
-
/* @__PURE__ */ e.jsxs(
|
|
130
|
-
/* @__PURE__ */ e.jsx(
|
|
131
|
-
N.map((s) => /* @__PURE__ */ e.jsx(
|
|
127
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(ce, { value: w, onValueChange: (s) => l(s), children: [
|
|
128
|
+
/* @__PURE__ */ e.jsx(de, { className: "w-full", children: /* @__PURE__ */ e.jsx(me, { placeholder: r("select_provider") }) }),
|
|
129
|
+
/* @__PURE__ */ e.jsxs(xe, { children: [
|
|
130
|
+
/* @__PURE__ */ e.jsx(T, { value: "", children: r("choose") }),
|
|
131
|
+
N.map((s) => /* @__PURE__ */ e.jsx(T, { value: s.value, children: s.label }, s.value))
|
|
132
132
|
] })
|
|
133
133
|
] }) }),
|
|
134
134
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -151,7 +151,7 @@ const Ne = () => {
|
|
|
151
151
|
/* @__PURE__ */ e.jsxs(
|
|
152
152
|
"button",
|
|
153
153
|
{
|
|
154
|
-
onClick: () =>
|
|
154
|
+
onClick: () => M(s),
|
|
155
155
|
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",
|
|
156
156
|
children: [
|
|
157
157
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -208,20 +208,20 @@ const Ne = () => {
|
|
|
208
208
|
/* @__PURE__ */ e.jsx(ye, { onClose: () => v(null), provider: c })
|
|
209
209
|
] })
|
|
210
210
|
] });
|
|
211
|
-
}, ke = y(() => import("./AddBlocks-
|
|
212
|
-
let
|
|
211
|
+
}, ke = y(() => import("./AddBlocks-IE14csoo.js")), _ = y(() => import("./Layers-Dav1kBNN.js")), Ce = y(() => import("./BrandingOptions-t_MjeHSM.js")), De = y(() => import("./index-QGA4ayU7.js").then((r) => r.cq));
|
|
212
|
+
let B = null;
|
|
213
213
|
const As = () => {
|
|
214
|
-
const r = k("sideBarComponents.top", []),
|
|
214
|
+
const r = k("sideBarComponents.top", []), t = k("sideBarComponents.bottom", []), [a, i] = V(pe), [p, n] = x(a), [o, w] = x(null), f = {
|
|
215
215
|
"add-blocks": ke,
|
|
216
|
-
layers:
|
|
216
|
+
layers: _,
|
|
217
217
|
"branding-options": Ce,
|
|
218
218
|
images: De
|
|
219
219
|
};
|
|
220
|
-
|
|
220
|
+
O(r, ({ name: l, panel: u }) => {
|
|
221
221
|
f[l] = u;
|
|
222
222
|
});
|
|
223
223
|
const c = (l) => {
|
|
224
|
-
clearTimeout(
|
|
224
|
+
clearTimeout(B), a !== "layers" && l === "layers" ? B = setTimeout(() => i("layers"), 500) : n(l), i(l);
|
|
225
225
|
}, v = k("dataBindingSupport", !1);
|
|
226
226
|
function N() {
|
|
227
227
|
const l = setTimeout(() => {
|
|
@@ -248,7 +248,7 @@ const As = () => {
|
|
|
248
248
|
},
|
|
249
249
|
size: "sm",
|
|
250
250
|
variant: a === "add-blocks" ? "default" : "outline",
|
|
251
|
-
children: /* @__PURE__ */ e.jsx(
|
|
251
|
+
children: /* @__PURE__ */ e.jsx(H, { className: "text-xl" })
|
|
252
252
|
}
|
|
253
253
|
),
|
|
254
254
|
/* @__PURE__ */ e.jsx(
|
|
@@ -257,7 +257,7 @@ const As = () => {
|
|
|
257
257
|
onClick: () => c("layers"),
|
|
258
258
|
size: "sm",
|
|
259
259
|
variant: a === "layers" ? "default" : "outline",
|
|
260
|
-
children: /* @__PURE__ */ e.jsx(
|
|
260
|
+
children: /* @__PURE__ */ e.jsx(A, { className: "w-4" })
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
263
|
/* @__PURE__ */ e.jsx(
|
|
@@ -266,11 +266,11 @@ const As = () => {
|
|
|
266
266
|
onClick: () => c("branding-options"),
|
|
267
267
|
size: "sm",
|
|
268
268
|
variant: a === "branding-options" ? "default" : "outline",
|
|
269
|
-
children: /* @__PURE__ */ e.jsx(
|
|
269
|
+
children: /* @__PURE__ */ e.jsx(I, { className: "w-4 max-w-[40px] text-xs" })
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
272
|
h.Children.toArray(
|
|
273
|
-
r.map(({ name: l, icon: u }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(
|
|
273
|
+
r.map(({ name: l, icon: u }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(E, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
274
274
|
b,
|
|
275
275
|
{
|
|
276
276
|
onClick: () => c(l),
|
|
@@ -283,7 +283,7 @@ const As = () => {
|
|
|
283
283
|
)
|
|
284
284
|
] }),
|
|
285
285
|
/* @__PURE__ */ e.jsx("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: h.Children.toArray(
|
|
286
|
-
|
|
286
|
+
t.map((l) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(E, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(l, {}) }))
|
|
287
287
|
) })
|
|
288
288
|
] }),
|
|
289
289
|
/* @__PURE__ */ e.jsx(
|
|
@@ -308,7 +308,7 @@ const As = () => {
|
|
|
308
308
|
onMouseEnter: () => {
|
|
309
309
|
o && clearTimeout(o);
|
|
310
310
|
},
|
|
311
|
-
children: h.createElement(
|
|
311
|
+
children: h.createElement(U(f, a, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
312
312
|
}
|
|
313
313
|
)
|
|
314
314
|
}
|
|
@@ -323,26 +323,26 @@ const As = () => {
|
|
|
323
323
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
324
324
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
325
325
|
] }),
|
|
326
|
-
children: v ? /* @__PURE__ */ e.jsxs(
|
|
327
|
-
/* @__PURE__ */ e.jsxs(
|
|
328
|
-
/* @__PURE__ */ e.jsxs(
|
|
329
|
-
/* @__PURE__ */ e.jsx(
|
|
326
|
+
children: v ? /* @__PURE__ */ e.jsxs(K, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
|
|
327
|
+
/* @__PURE__ */ e.jsxs(z, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
328
|
+
/* @__PURE__ */ e.jsxs(C, { value: "layers", children: [
|
|
329
|
+
/* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
|
|
330
330
|
" Layers"
|
|
331
331
|
] }),
|
|
332
|
-
/* @__PURE__ */ e.jsxs(
|
|
332
|
+
/* @__PURE__ */ e.jsxs(C, { value: "data-provider", children: [
|
|
333
333
|
/* @__PURE__ */ e.jsx(ue, { className: "mr-2 w-3" }),
|
|
334
334
|
"Data"
|
|
335
335
|
] })
|
|
336
336
|
] }),
|
|
337
|
-
/* @__PURE__ */ e.jsx(
|
|
338
|
-
/* @__PURE__ */ e.jsx(
|
|
339
|
-
] }) : /* @__PURE__ */ e.
|
|
340
|
-
/* @__PURE__ */ e.
|
|
341
|
-
/* @__PURE__ */ e.jsx(
|
|
337
|
+
/* @__PURE__ */ e.jsx(D, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(_) }),
|
|
338
|
+
/* @__PURE__ */ e.jsx(D, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ne, {}) })
|
|
339
|
+
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(K, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
|
|
340
|
+
/* @__PURE__ */ e.jsx(z, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(C, { value: "layers", children: [
|
|
341
|
+
/* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
|
|
342
342
|
" Layers"
|
|
343
|
-
] }),
|
|
344
|
-
/* @__PURE__ */ e.jsx("
|
|
345
|
-
] })
|
|
343
|
+
] }) }),
|
|
344
|
+
/* @__PURE__ */ e.jsx(D, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: h.createElement(_) })
|
|
345
|
+
] }) })
|
|
346
346
|
}
|
|
347
347
|
) })
|
|
348
348
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("@radix-ui/react-icons"),i=require("react"),k=require("jotai"),a=require("lodash-es"),s=require("./index-bfKqnRvZ.cjs"),g=require("lucide-react"),C=require("@chaibuilder/runtime"),q=require("react-i18next"),b=require("./index-gi1LIOCw.cjs"),P=require("./index-hS9T9Nub.cjs"),T=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const D=({provider:t,onClose:x})=>{const{t:n}=q.useTranslation(),[l,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(u=>p(u))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:c=>c?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[n("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(P.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(b.JsonView,{data:l,shouldExpandNode:b.allExpanded,style:{...b.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 A({children:t,name:x,onRemove:n}){const{t:l}=q.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:n,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const _=()=>{const{t}=q.useTranslation(),x=i.useMemo(()=>C.getChaiDataProviders(),[]),[n,l]=s.usePageDataProviders(),[,p]=k.useAtom(s.pageSyncStateAtom),[c,u]=i.useState(a.filter(x,r=>a.map(n,"providerKey").includes(r.providerKey))),[E,v]=i.useState(""),[d,f]=i.useState(null),R=a.filter(x.map(r=>a.map(c,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!a.isNull(r)),o=r=>{const j=a.find(x,{providerKey:r});u(m=>[...m,j]),l(m=>[...m,{providerKey:j.providerKey,args:{}}]),v(""),p("UNSAVED")},h=r=>{u(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),l(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),p("UNSAVED")},S=r=>f(r);return a.isEmpty(x)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[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:E,onValueChange:r=>o(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")}),R.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 ${c.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:c.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:()=>S(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","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"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(A,{onRemove:()=>h(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","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"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(D,{onClose:()=>f(null),provider:d})]})]})},B=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-tomDo_Is.cjs"))),y=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-FRHRlPIH.cjs"))),z=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-BUmE4f72.cjs"))),I=i.lazy(()=>Promise.resolve().then(()=>require("./index-bfKqnRvZ.cjs")).then(t=>t.ImagesPanel));let N=null;const K=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[n,l]=k.useAtom(s.activePanelAtom),[p,c]=i.useState(n),[u,E]=i.useState(null),v={"add-blocks":B,layers:y,"branding-options":z,images:I};a.each(t,({name:o,panel:h})=>{v[o]=h});const d=o=>{clearTimeout(N),n!=="layers"&&o==="layers"?N=setTimeout(()=>l("layers"),500):c(o),l(o)},f=s.useBuilderProp("dataBindingSupport",!1);function R(){const o=setTimeout(()=>{u&&(d("layers"),clearTimeout(u))},500);E(o)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!=="layers"?e.jsxRuntimeExports.jsx("div",{onMouseEnter:R,onClick:()=>d("layers"),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{d("add-blocks")},size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("layers"),size:"sm",variant:n==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("branding-options"),size:"sm",variant:n==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:o,icon:h})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(o),size:"sm",className:"w-10",variant:n===o?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(x.map(o=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(o,{})})))})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${n!=="layers"?"translate-x-0":"-translate-x-full"}`,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:T.cn("relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",n==="layers"?"":"z-[100]"),onMouseEnter:()=>{u&&clearTimeout(u)},children:i.createElement(a.get(v,n,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),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:f?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",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:"layers",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"mr-2 h-3"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(g.DatabaseIcon,{className:"mr-2 w-3"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(_,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md bg-gray-200 py-1",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"ml-2 mr-2 h-4"})," Layers"]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)})]})})})]})};exports.default=K;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("@radix-ui/react-icons"),i=require("react"),k=require("jotai"),a=require("lodash-es"),s=require("./index-ERorPL9q.cjs"),g=require("lucide-react"),S=require("@chaibuilder/runtime"),q=require("react-i18next"),b=require("./index-gi1LIOCw.cjs"),C=require("./index-xJ8LmB04.cjs"),P=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const D=({provider:t,onClose:x})=>{const{t:n}=q.useTranslation(),[l,p]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(u=>p(u))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:c=>c?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[n("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(C.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(b.JsonView,{data:l,shouldExpandNode:b.allExpanded,style:{...b.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 A({children:t,name:x,onRemove:n}){const{t:l}=q.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:n,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const _=()=>{const{t}=q.useTranslation(),x=i.useMemo(()=>S.getChaiDataProviders(),[]),[n,l]=s.usePageDataProviders(),[,p]=k.useAtom(s.pageSyncStateAtom),[c,u]=i.useState(a.filter(x,r=>a.map(n,"providerKey").includes(r.providerKey))),[E,f]=i.useState(""),[d,v]=i.useState(null),R=a.filter(x.map(r=>a.map(c,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!a.isNull(r)),o=r=>{const j=a.find(x,{providerKey:r});u(m=>[...m,j]),l(m=>[...m,{providerKey:j.providerKey,args:{}}]),f(""),p("UNSAVED")},h=r=>{u(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),l(j=>a.filter(j,m=>m.providerKey!==r.providerKey)),p("UNSAVED")},T=r=>v(r);return a.isEmpty(x)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[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:E,onValueChange:r=>o(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")}),R.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 ${c.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:c.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:()=>T(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","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"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(A,{onRemove:()=>h(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","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"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(D,{onClose:()=>v(null),provider:d})]})]})},B=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-OpGQyVQZ.cjs"))),y=i.lazy(()=>Promise.resolve().then(()=>require("./Layers-05Ut4xZA.cjs"))),z=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-tBWzqas5.cjs"))),I=i.lazy(()=>Promise.resolve().then(()=>require("./index-ERorPL9q.cjs")).then(t=>t.ImagesPanel));let N=null;const K=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),x=s.useBuilderProp("sideBarComponents.bottom",[]),[n,l]=k.useAtom(s.activePanelAtom),[p,c]=i.useState(n),[u,E]=i.useState(null),f={"add-blocks":B,layers:y,"branding-options":z,images:I};a.each(t,({name:o,panel:h})=>{f[o]=h});const d=o=>{clearTimeout(N),n!=="layers"&&o==="layers"?N=setTimeout(()=>l("layers"),500):c(o),l(o)},v=s.useBuilderProp("dataBindingSupport",!1);function R(){const o=setTimeout(()=>{u&&(d("layers"),clearTimeout(u))},500);E(o)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!=="layers"?e.jsxRuntimeExports.jsx("div",{onMouseEnter:R,onClick:()=>d("layers"),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{d("add-blocks")},size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("layers"),size:"sm",variant:n==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("branding-options"),size:"sm",variant:n==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(w.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:o,icon:h})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(o),size:"sm",className:"w-10",variant:n===o?"default":"outline",children:e.jsxRuntimeExports.jsx(h,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:i.Children.toArray(x.map(o=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(o,{})})))})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${n!=="layers"?"translate-x-0":"-translate-x-full"}`,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 h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",n==="layers"?"":"z-[100]"),onMouseEnter:()=>{u&&clearTimeout(u)},children:i.createElement(a.get(f,n,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),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:v?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",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:"layers",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"mr-2 h-3"})," Layers"]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(g.DatabaseIcon,{className:"mr-2 w-3"}),"Data"]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(_,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(g.ListTreeIcon,{className:"mr-2 h-3"})," Layers"]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"layers",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(y)})]})})})})]})};exports.default=K;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),l=require("@radix-ui/react-icons"),r=require("./index-ERorPL9q.cjs"),a=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");const o=()=>r.useBuilderProp("languages",["en"]),c=()=>o().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(l.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"})]})})]})}),p=()=>{const{savePage:i,syncState:s}=r.useSavePage(),{t:x}=a.useTranslation(),u=n.useMemo(()=>{switch(s){case"SAVING":return"animate-pulse bg-gray-500 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]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Tooltip,{children:[e.jsxRuntimeExports.jsx(r.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(r.Button,{onClick:t=>{t.preventDefault(),i()},className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${u}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),s==="SAVING"?"Saving...":s==="SAVED"?x("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(r.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:s==="SAVING"?"Saving...":s==="SAVED"?"Saved":"Save changes"})})]})})},m=()=>{const i=r.useBuilderProp("topBarComponents.left",[]),s=r.useBuilderProp("topBarComponents.center",[]),x=r.useBuilderProp("topBarComponents.right",[]),u=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(i.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(c,{}),e.jsxRuntimeExports.jsx(r.Separator,{orientation:"vertical"}),u?e.jsxRuntimeExports.jsx(p,{}):null,n.Children.toArray(x.map(t=>e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(r.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(t,{})})))]})]})};exports.default=m;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import o, { useMemo as m, Suspense as c } from "react";
|
|
3
3
|
import { FontFamilyIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import { i as a, aj as d, ak as h, al as u, am as j, at as g, au as v, an as r, a9 as f, av as S, aw as b, B as N, ax as w, S as p, ay as y } from "./index-
|
|
4
|
+
import { i as a, aj as d, ak as h, al as u, am as j, at as g, au as v, an as r, a9 as f, av as S, aw as b, B as N, ax as w, S as p, ay as y } from "./index-QGA4ayU7.js";
|
|
5
5
|
import { useTranslation as C } from "react-i18next";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "lodash-es";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-ERorPL9q.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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-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-i18next");const g=async(d,E)=>new Promise((a,n)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>n(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[c,q]=o.useState(0),[u,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let i=c+1;s&&(s.preventDefault(),i=1),m(!0),q(i);const p={query:j,page:i};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(i===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...n,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,a).then(i=>{var p,r;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),R((r=i==null?void 0:i.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!l.isEmpty(n)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;
|
|
@@ -3,7 +3,7 @@ import { useState as p, useEffect as D } from "react";
|
|
|
3
3
|
import { isEmpty as d, startCase as E } from "lodash-es";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as U } from "unsplash-js";
|
|
6
|
-
import { i as V, bc as B, aT as F, aU as K, aV as O, aj as P, ak as C, al as S, am as k, an as h, bf as Q, B as H } from "./index-
|
|
6
|
+
import { i as V, bc as B, aT as F, aU as K, aV as O, aj as P, ak as C, al as S, am as k, an as h, bf as Q, B as H } from "./index-QGA4ayU7.js";
|
|
7
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
8
|
import { Loader as $ } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -3,7 +3,7 @@ import { useState as a, useEffect as w } from "react";
|
|
|
3
3
|
import { isEmpty as g, map as b } from "lodash-es";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import { i as j, bf as A } from "./index-
|
|
6
|
+
import { i as j, bf as A } from "./index-QGA4ayU7.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
9
9
|
import "clsx";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),l=require("lodash-es"),d=require("@radix-ui/react-icons"),q=require("jotai"),m=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),l=require("lodash-es"),d=require("@radix-ui/react-icons"),q=require("jotai"),m=require("./index-ERorPL9q.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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-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-i18next");const N=q.atom([]),I=({isModalView:t,onSelect:a})=>{const E=m.useBuilderProp("uploadMediaCallback",()=>""),p=m.useBuilderProp("fetchMediaCallback",()=>[]),[i,u]=q.useAtom(N),[n,j]=r.useState(!1),[h,f]=r.useState(!1),[x,c]=r.useState(),[g,R]=r.useState("");r.useEffect(()=>{(async()=>{f(!0);const s=await p();u(s||[]),f(!1)})()},[]);const v=s=>{var o,b;s&&((b=(o=s==null?void 0:s.target)==null?void 0:o.files)==null?void 0:b.length)>0&&c(s.target.files[0])},y=async()=>{j(!0);try{const{url:s}=await E(x);a(s),c(void 0);const o=await p();u(o)}catch(s){u([]),R((s==null?void 0:s.message)||"Something went wrong.")}j(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(x),alt:"",className:"h-auto w-full max-w-sm rounded-md max-h-96 object-contain"}),g&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:g}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:n,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[n?e.jsxRuntimeExports.jsx(d.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(d.UploadIcon,{className:"animate-bounce"})," ",n?"Uploading...":"Upload"]}),!n&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>c(void 0),children:[e.jsxRuntimeExports.jsx(d.Cross1Icon,{})," Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:t?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:t?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(m.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${t?"px-2":""} pt-2`,children:[l.isEmpty(i)&&h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),l.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),t?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:l.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>a(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.thumbUrl})})},s.id))}):l.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>a(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.url})})},s.id))]})]})};exports.default=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-ERorPL9q.cjs"),g=require("./empty-slot-2LSrWJaY.cjs"),R=require("./form-KkP1F7h1.cjs"),f=require("./index-xJ8LmB04.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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-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-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");const b=({closeModal:i})=>{var l,q;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(o=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...o,...a}})},h={name:g.u({title:"Page Name",default:r.name}),slug:g.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((q=r.slug)==null?void 0:q.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { kebabCase as j } from "lodash-es";
|
|
4
|
-
import { ae as b, B as u, ad as C, b1 as A } from "./index-
|
|
4
|
+
import { ae as b, B as u, ad as C, b1 as A } from "./index-QGA4ayU7.js";
|
|
5
5
|
import { u as g } from "./empty-slot-5FRrRq1E.js";
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { g as N } from "./index-
|
|
6
|
+
import { F as D } from "./form-faX0Yn4Q.js";
|
|
7
|
+
import { g as N } from "./index-nrRnwUaC.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as a, C as n, E as c, F as x, H as j, B as d } from "./index-
|
|
2
|
+
import { A as a, C as n, E as c, F as x, H as j, B as d } from "./index-QGA4ayU7.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "lodash-es";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-ERorPL9q.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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-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-i18next");const x=({open:t,onCancel:q=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:t,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:q,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-xJ8LmB04.cjs"),e=require("./index-ERorPL9q.cjs"),r=require("react-i18next");require("i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("react-textarea-autosize");require("jotai");require("flagged");require("react-dnd");require("lodash-es");require("@minoru/react-dnd-treeview");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@radix-ui/react-icons");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./MODIFIERS-2FeVfZQ9.cjs");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlocksStore=e.useBlocksStore;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>r.useTranslation});
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as q } from "./index-
|
|
2
|
-
import { J as ss, a8 as es, K as os, aa as as, L as ts, a7 as rs, s as is, t as ps, i as ms, v as ls, M as us, N as ds, O as cs, P as Bs, Q as ks, R as ns, U as Cs, l as Ss, V as Ps, W as gs, X as vs, Y as ys, h as As, I as Is, k as hs, Z as Ms, a9 as Rs, a0 as Us, $ as Ds, _ as bs, j as fs, a6 as xs, ab as Os, ac as Ts, a1 as Hs, a3 as Ls, a2 as Ws, m as Zs, a4 as js, a5 as ws } from "./index-
|
|
1
|
+
import { C as q } from "./index-nrRnwUaC.js";
|
|
2
|
+
import { J as ss, a8 as es, K as os, aa as as, L as ts, a7 as rs, s as is, t as ps, i as ms, v as ls, M as us, N as ds, O as cs, P as Bs, Q as ks, R as ns, U as Cs, l as Ss, V as Ps, W as gs, X as vs, Y as ys, h as As, I as Is, k as hs, Z as Ms, a9 as Rs, a0 as Us, $ as Ds, _ as bs, j as fs, a6 as xs, ab as Os, ac as Ts, a1 as Hs, a3 as Ls, a2 as Ws, m as Zs, a4 as js, a5 as ws } from "./index-QGA4ayU7.js";
|
|
3
3
|
import { useTranslation as Fs } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-ERorPL9q.cjs"),l=require("./index-xJ8LmB04.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.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-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-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|