@chaibuilder/sdk 1.2.21 → 1.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CanvasArea-_BFTu_8b.js → CanvasArea-MajWGr9z.js} +1 -1
- package/dist/{CanvasArea-eOKWgAXR.cjs → CanvasArea-MmTlc5Vb.cjs} +1 -1
- package/dist/{CurrentPage-iB6nD9Rr.cjs → CurrentPage-LpLr0lDI.cjs} +1 -1
- package/dist/{CurrentPage-VAuh7F6E.js → CurrentPage-oPZN6Gwj.js} +2 -2
- package/dist/{Outline-jTFv40r5.js → Outline-2OxsXs1-.js} +1 -1
- package/dist/{Outline-g8XFGm2t.cjs → Outline-7CCnnzmK.cjs} +1 -1
- package/dist/{PagesPanel-Wx9JG5qR.cjs → PagesPanel-8536oBWB.cjs} +1 -1
- package/dist/{PagesPanel-oky0X1Ww.js → PagesPanel-pRKHw-AZ.js} +3 -3
- package/dist/{ProjectPanel-WjVBiB-e.js → ProjectPanel-iU6DY-Yp.js} +3 -3
- package/dist/{ProjectPanel-64Xg3Y_p.cjs → ProjectPanel-oILsUWOH.cjs} +1 -1
- package/dist/{Settings-mNRbprbx.js → Settings-BhSrj-cE.js} +1 -1
- package/dist/{Settings-Tlqq4mqN.cjs → Settings-jHiYmt0y.cjs} +1 -1
- package/dist/{SidePanels-pQImwDI6.js → SidePanels-OLOUpKn4.js} +44 -44
- package/dist/{SidePanels-ZF4Q2R29.cjs → SidePanels-bcJJocSq.cjs} +1 -1
- package/dist/{add-page-modal-xCUKJiZv.cjs → add-page-modal-IsqDdK7X.cjs} +1 -1
- package/dist/{add-page-modal-1mGGtAB_.js → add-page-modal-Jni6CY1x.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-yAJNstCa.js → delete-page-modal-0WiMZFxr.js} +2 -2
- package/dist/{delete-page-modal-Qa0YqBRl.cjs → delete-page-modal-c3b-GCap.cjs} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{index-9YNkdni8.cjs → index-0bwkNnA0.cjs} +1 -1
- package/dist/{index-kAjyc_KA.js → index-UP_4awU9.js} +1 -1
- package/dist/{index-iQEapw2W.js → index-_VPpjzJu.js} +2 -2
- package/dist/{index-PlZjGTTr.cjs → index-nwAgi0aD.cjs} +1 -1
- package/dist/{page-viewer-SU_BqZDK.js → page-viewer-L1Dmgj-c.js} +3 -3
- package/dist/{page-viewer-ZA-sJD82.cjs → page-viewer-TnxHhq7S.cjs} +1 -1
- package/dist/{project-general-setting-GuQyvAHS.cjs → project-general-setting-1Ot1RU43.cjs} +1 -1
- package/dist/{project-general-setting-eEmhoFvb.js → project-general-setting-sUP7JqWK.js} +2 -2
- package/dist/{single-page-detail-nxWIy6e7.js → single-page-detail-FXg_NebW.js} +3 -3
- package/dist/{single-page-detail-Z677SWqt.cjs → single-page-detail-btEKYXjE.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { KeyboardIcon as J, PlusIcon as q, Half2Icon as Y } from "@radix-ui/react-icons";
|
|
3
|
-
import v, { useState as p, useEffect as Z, useMemo as $, lazy as b, Suspense as
|
|
3
|
+
import v, { useState as p, useEffect as Z, useMemo as $, lazy as b, Suspense as y } from "react";
|
|
4
4
|
import { useAtom as H } from "jotai";
|
|
5
5
|
import { filter as w, map as E, isNull as G, find as Q, isEmpty as W, each as X, get as ee } from "lodash-es";
|
|
6
|
-
import { ad as F, ae as L, af as R, ag as U, ah as se, A as re, a as ae, b as le, c as ie, d as te, e as oe, f as ne, g as ce, ai as de, y as me, C as xe, aj as pe, ak as he, al as ue, am as fe, an as B, ao as je, ap as ve, aq as ge, B as g, ar as be, as as z, h as T, at as
|
|
7
|
-
import { ListTreeIcon as _, DatabaseIcon as
|
|
6
|
+
import { ad as F, ae as L, af as R, ag as U, ah as se, A as re, a as ae, b as le, c as ie, d as te, e as oe, f as ne, g as ce, ai as de, y as me, C as xe, aj as pe, ak as he, al as ue, am as fe, an as B, ao as je, ap as ve, aq as ge, B as g, ar as be, as as z, h as T, at as Ne, S as V, au as O, av as I, aw as A, ax as S } from "./index-IPJAbzzO.js";
|
|
7
|
+
import { ListTreeIcon as _, DatabaseIcon as ye } from "lucide-react";
|
|
8
8
|
import { getChaiDataProviders as we } from "@chaibuilder/runtime";
|
|
9
|
-
import { useTranslation as
|
|
9
|
+
import { useTranslation as N } from "react-i18next";
|
|
10
10
|
import { J as ke, a as Ce, d as De } from "./index-e0c8PmRQ.js";
|
|
11
|
-
import { E as Te } from "./index-
|
|
11
|
+
import { E as Te } from "./index-UP_4awU9.js";
|
|
12
12
|
import { c as Ae } from "./Functions-7jnEwJyw.js";
|
|
13
13
|
import { O as i } from "./MODIFIERS-WQdaNvb8.js";
|
|
14
14
|
import { useFeature as Se } from "flagged";
|
|
@@ -46,13 +46,13 @@ import "react-dnd";
|
|
|
46
46
|
import "@minoru/react-dnd-treeview";
|
|
47
47
|
import "react-hotkeys-hook";
|
|
48
48
|
const _e = ({ provider: s, onClose: o }) => {
|
|
49
|
-
const { t:
|
|
49
|
+
const { t: l } = N(), [a, h] = p(null);
|
|
50
50
|
return Z(() => {
|
|
51
51
|
s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => h(n));
|
|
52
52
|
}, [s]), s ? /* @__PURE__ */ e.jsx(F, { onOpenChange: (c) => c ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(L, { children: [
|
|
53
53
|
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
54
54
|
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
55
|
-
|
|
55
|
+
l("data_provider"),
|
|
56
56
|
": ",
|
|
57
57
|
s.name
|
|
58
58
|
] }),
|
|
@@ -61,7 +61,7 @@ const _e = ({ provider: s, onClose: o }) => {
|
|
|
61
61
|
/* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsx(
|
|
62
62
|
ke,
|
|
63
63
|
{
|
|
64
|
-
data:
|
|
64
|
+
data: a,
|
|
65
65
|
shouldExpandNode: Ce,
|
|
66
66
|
style: {
|
|
67
67
|
...De,
|
|
@@ -76,9 +76,9 @@ const _e = ({ provider: s, onClose: o }) => {
|
|
|
76
76
|
function Pe({
|
|
77
77
|
children: s,
|
|
78
78
|
name: o,
|
|
79
|
-
onRemove:
|
|
79
|
+
onRemove: l
|
|
80
80
|
}) {
|
|
81
|
-
const { t:
|
|
81
|
+
const { t: a } = N();
|
|
82
82
|
return /* @__PURE__ */ e.jsxs(re, { children: [
|
|
83
83
|
/* @__PURE__ */ e.jsx(ae, { asChild: !0, children: s }),
|
|
84
84
|
/* @__PURE__ */ e.jsxs(le, { children: [
|
|
@@ -86,29 +86,29 @@ function Pe({
|
|
|
86
86
|
/* @__PURE__ */ e.jsx(
|
|
87
87
|
te,
|
|
88
88
|
{
|
|
89
|
-
dangerouslySetInnerHTML: { __html:
|
|
89
|
+
dangerouslySetInnerHTML: { __html: a("remove_provider_confirmation").replace("{name}", o) }
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
/* @__PURE__ */ e.jsx(oe, { children:
|
|
92
|
+
/* @__PURE__ */ e.jsx(oe, { children: a("remove_provider_warning") })
|
|
93
93
|
] }),
|
|
94
94
|
/* @__PURE__ */ e.jsxs(ne, { children: [
|
|
95
|
-
/* @__PURE__ */ e.jsx(ce, { children:
|
|
96
|
-
/* @__PURE__ */ e.jsx(de, { onClick:
|
|
95
|
+
/* @__PURE__ */ e.jsx(ce, { children: a("cancel") }),
|
|
96
|
+
/* @__PURE__ */ e.jsx(de, { onClick: l, className: "bg-red-600 hover:bg-red-700", children: a("remove") })
|
|
97
97
|
] })
|
|
98
98
|
] })
|
|
99
99
|
] });
|
|
100
100
|
}
|
|
101
101
|
const Ke = () => {
|
|
102
|
-
const { t: s } =
|
|
103
|
-
w(o, (r) => E(
|
|
102
|
+
const { t: s } = N(), o = $(() => we(), []), [l, a] = me(), [, h] = H(xe), [c, n] = p(
|
|
103
|
+
w(o, (r) => E(l, "providerKey").includes(r.providerKey))
|
|
104
104
|
), [k, u] = p(""), [f, j] = p(null), d = w(
|
|
105
105
|
o.map((r) => E(c, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
|
|
106
106
|
(r) => !G(r)
|
|
107
107
|
), C = (r) => {
|
|
108
108
|
const x = Q(o, { providerKey: r });
|
|
109
|
-
n((m) => [...m, x]),
|
|
109
|
+
n((m) => [...m, x]), a((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""), h("UNSAVED");
|
|
110
110
|
}, D = (r) => {
|
|
111
|
-
n((x) => w(x, (m) => m.providerKey !== r.providerKey)),
|
|
111
|
+
n((x) => w(x, (m) => m.providerKey !== r.providerKey)), a((x) => w(x, (m) => m.providerKey !== r.providerKey)), h("UNSAVED");
|
|
112
112
|
}, t = (r) => j(r);
|
|
113
113
|
return W(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
114
114
|
s("no_data_providers"),
|
|
@@ -202,11 +202,11 @@ const Ke = () => {
|
|
|
202
202
|
] })
|
|
203
203
|
] });
|
|
204
204
|
}, Ee = () => {
|
|
205
|
-
const { t: s } =
|
|
205
|
+
const { t: s } = N(), o = {
|
|
206
206
|
"ctrl + Z": "Undo",
|
|
207
207
|
"ctrl + Y": "Redo",
|
|
208
208
|
"ctrl + D": "Duplicate"
|
|
209
|
-
},
|
|
209
|
+
}, l = {
|
|
210
210
|
// "ctrl + /": "Rename block",
|
|
211
211
|
"ctrl + S": "Save page",
|
|
212
212
|
esc: "Deselect blocks",
|
|
@@ -220,21 +220,21 @@ const Ke = () => {
|
|
|
220
220
|
/* @__PURE__ */ e.jsxs(L, { className: "sm:max-w-[525px]", children: [
|
|
221
221
|
/* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx(U, { children: s("Keyboard shortcuts") }) }),
|
|
222
222
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
|
|
223
|
-
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((
|
|
224
|
-
/* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(
|
|
225
|
-
/* @__PURE__ */ e.jsx("div", { children: s(o[
|
|
226
|
-
] },
|
|
227
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(
|
|
228
|
-
/* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(
|
|
229
|
-
/* @__PURE__ */ e.jsx("div", { children: s(a
|
|
230
|
-
] })) })
|
|
223
|
+
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
224
|
+
/* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
|
|
225
|
+
/* @__PURE__ */ e.jsx("div", { children: s(o[a]) })
|
|
226
|
+
] }, a)) }),
|
|
227
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(l).map((a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
228
|
+
/* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(a) }),
|
|
229
|
+
/* @__PURE__ */ e.jsx("div", { children: s(l[a]) })
|
|
230
|
+
] }, a)) })
|
|
231
231
|
] }) })
|
|
232
232
|
] })
|
|
233
233
|
] });
|
|
234
|
-
}, Be = b(() => import("./AddBlocks-WgpssWmQ.js")), P = b(() => import("./Outline-
|
|
234
|
+
}, Be = b(() => import("./AddBlocks-WgpssWmQ.js")), P = b(() => import("./Outline-2OxsXs1-.js")), K = b(() => import("./ListTree-dvxHTXs4.js")), ze = b(() => import("./BrandingOptions-4961TxX2.js")), Ve = b(() => import("./index-IPJAbzzO.js").then((s) => s.cq));
|
|
235
235
|
let M = null;
|
|
236
236
|
const _s = () => {
|
|
237
|
-
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [
|
|
237
|
+
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [l, a] = H(Ne), [h, c] = p(l), [n, k] = p(null), { t: u } = N(), f = Se("arborist"), j = {
|
|
238
238
|
"add-blocks": Be,
|
|
239
239
|
[i]: f ? K : P,
|
|
240
240
|
"branding-options": ze,
|
|
@@ -244,7 +244,7 @@ const _s = () => {
|
|
|
244
244
|
j[t] = r;
|
|
245
245
|
});
|
|
246
246
|
const d = (t) => {
|
|
247
|
-
clearTimeout(M),
|
|
247
|
+
clearTimeout(M), l !== i && t === i ? M = setTimeout(() => a(i), 500) : c(t), a(t);
|
|
248
248
|
}, C = T("dataBindingSupport", !1);
|
|
249
249
|
function D() {
|
|
250
250
|
const t = setTimeout(() => {
|
|
@@ -253,7 +253,7 @@ const _s = () => {
|
|
|
253
253
|
k(t);
|
|
254
254
|
}
|
|
255
255
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
256
|
-
|
|
256
|
+
l !== i ? /* @__PURE__ */ e.jsx(
|
|
257
257
|
"div",
|
|
258
258
|
{
|
|
259
259
|
onMouseEnter: D,
|
|
@@ -270,7 +270,7 @@ const _s = () => {
|
|
|
270
270
|
d("add-blocks");
|
|
271
271
|
},
|
|
272
272
|
size: "sm",
|
|
273
|
-
variant:
|
|
273
|
+
variant: l === "add-blocks" ? "default" : "outline",
|
|
274
274
|
children: /* @__PURE__ */ e.jsx(q, { className: "text-xl" })
|
|
275
275
|
}
|
|
276
276
|
),
|
|
@@ -279,7 +279,7 @@ const _s = () => {
|
|
|
279
279
|
{
|
|
280
280
|
onClick: () => d(i),
|
|
281
281
|
size: "sm",
|
|
282
|
-
variant:
|
|
282
|
+
variant: l === i ? "default" : "outline",
|
|
283
283
|
children: /* @__PURE__ */ e.jsx(_, { className: "w-4" })
|
|
284
284
|
}
|
|
285
285
|
),
|
|
@@ -288,18 +288,18 @@ const _s = () => {
|
|
|
288
288
|
{
|
|
289
289
|
onClick: () => d("branding-options"),
|
|
290
290
|
size: "sm",
|
|
291
|
-
variant:
|
|
291
|
+
variant: l === "branding-options" ? "default" : "outline",
|
|
292
292
|
children: /* @__PURE__ */ e.jsx(Y, { className: "w-4 max-w-[40px] text-xs" })
|
|
293
293
|
}
|
|
294
294
|
),
|
|
295
295
|
v.Children.toArray(
|
|
296
|
-
s.map(({ name: t, icon: r }) => /* @__PURE__ */ e.jsx(
|
|
296
|
+
s.map(({ name: t, icon: r }) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
297
297
|
g,
|
|
298
298
|
{
|
|
299
299
|
onClick: () => d(t),
|
|
300
300
|
size: "sm",
|
|
301
301
|
className: "w-10",
|
|
302
|
-
variant:
|
|
302
|
+
variant: l === t ? "default" : "outline",
|
|
303
303
|
children: /* @__PURE__ */ e.jsx(r, {})
|
|
304
304
|
}
|
|
305
305
|
) }))
|
|
@@ -308,16 +308,16 @@ const _s = () => {
|
|
|
308
308
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
309
309
|
/* @__PURE__ */ e.jsx(Ee, {}),
|
|
310
310
|
v.Children.toArray(
|
|
311
|
-
o.map((t) => /* @__PURE__ */ e.jsx(
|
|
311
|
+
o.map((t) => /* @__PURE__ */ e.jsx(y, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
312
312
|
)
|
|
313
313
|
] })
|
|
314
314
|
] }),
|
|
315
315
|
/* @__PURE__ */ e.jsx(
|
|
316
316
|
"div",
|
|
317
317
|
{
|
|
318
|
-
className: `absolute left-14 z-[50] h-full w-fit border-r bg-background duration-500 ease-in-out ${
|
|
318
|
+
className: `absolute left-14 z-[50] h-full w-fit min-w-[200px] border-r bg-background duration-500 ease-in-out ${l !== i ? "translate-x-0" : "-translate-x-full"}`,
|
|
319
319
|
children: /* @__PURE__ */ e.jsx(
|
|
320
|
-
|
|
320
|
+
y,
|
|
321
321
|
{
|
|
322
322
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
|
|
323
323
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -329,12 +329,12 @@ const _s = () => {
|
|
|
329
329
|
{
|
|
330
330
|
className: Ae(
|
|
331
331
|
"relative h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1",
|
|
332
|
-
|
|
332
|
+
l === i ? "" : "z-[100]"
|
|
333
333
|
),
|
|
334
334
|
onMouseEnter: () => {
|
|
335
335
|
n && clearTimeout(n);
|
|
336
336
|
},
|
|
337
|
-
children: v.createElement(ee(j,
|
|
337
|
+
children: v.createElement(ee(j, l, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
338
338
|
}
|
|
339
339
|
)
|
|
340
340
|
}
|
|
@@ -342,7 +342,7 @@ const _s = () => {
|
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
344
|
/* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
|
|
345
|
-
|
|
345
|
+
y,
|
|
346
346
|
{
|
|
347
347
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
|
|
348
348
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -357,7 +357,7 @@ const _s = () => {
|
|
|
357
357
|
u("Outline")
|
|
358
358
|
] }),
|
|
359
359
|
/* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
|
|
360
|
-
/* @__PURE__ */ e.jsx(
|
|
360
|
+
/* @__PURE__ */ e.jsx(ye, { className: "mr-2 w-3" }),
|
|
361
361
|
u("Data")
|
|
362
362
|
] })
|
|
363
363
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),k=require("@radix-ui/react-icons"),i=require("react"),D=require("jotai"),u=require("lodash-es"),s=require("./index-9PHdn80L.cjs"),R=require("lucide-react"),K=require("@chaibuilder/runtime"),g=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),S=require("./index-9YNkdni8.cjs"),I=require("./Functions-N3yhPYKY.cjs"),l=require("./MODIFIERS-9EwxLM8V.cjs"),C=require("flagged");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const P=({provider:t,onClose:a})=>{const{t:n}=g.useTranslation(),[o,h]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(c=>h(c))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:d=>d?"":a(),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(S.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:o,shouldExpandNode:w.allExpanded,style:{...w.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function O({children:t,name:a,onRemove:n}){const{t:o}=g.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:o("remove_provider_confirmation").replace("{name}",a)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:o("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:o("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:n,className:"bg-red-600 hover:bg-red-700",children:o("remove")})]})]})]})}const L=()=>{const{t}=g.useTranslation(),a=i.useMemo(()=>K.getChaiDataProviders(),[]),[n,o]=s.usePageDataProviders(),[,h]=D.useAtom(s.pageSyncStateAtom),[d,c]=i.useState(u.filter(a,r=>u.map(n,"providerKey").includes(r.providerKey))),[b,E]=i.useState(""),[v,f]=i.useState(null),m=u.filter(a.map(r=>u.map(d,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),N=r=>{const p=u.find(a,{providerKey:r});c(j=>[...j,p]),o(j=>[...j,{providerKey:p.providerKey,args:{}}]),E(""),h("UNSAVED")},y=r=>{c(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),o(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),h("UNSAVED")},x=r=>f(r);return u.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:b,onValueChange:r=>N(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")}),m.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 ${d.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:d.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:()=>x(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(O,{onRemove:()=>y(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(P,{onClose:()=>f(null),provider:v})]})]})},A=()=>{const{t}=g.useTranslation(),a={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},n={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx(s.Button,{size:"sm",className:"w-10",variant:"outline",children:e.jsxRuntimeExports.jsx(k.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(a).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(o)}),e.jsxRuntimeExports.jsx("div",{children:t(a[o])})]},o))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(n).map(o=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(o)}),e.jsxRuntimeExports.jsx("div",{children:t(n[o])})]}))})]})})]})]})},U=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-157fSrJX.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./Outline-g8XFGm2t.cjs"))),q=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-gTmusfso.cjs"))),B=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-nwXR9TMl.cjs"))),Y=i.lazy(()=>Promise.resolve().then(()=>require("./index-9PHdn80L.cjs")).then(t=>t.ImagesPanel));let _=null;const z=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),a=s.useBuilderProp("sideBarComponents.bottom",[]),[n,o]=D.useAtom(s.activePanelAtom),[h,d]=i.useState(n),[c,b]=i.useState(null),{t:E}=g.useTranslation(),v=C.useFeature("arborist"),f={"add-blocks":U,[l.OUTLINE_KEY]:v?q:T,"branding-options":B,images:Y};u.each(t,({name:x,panel:r})=>{f[x]=r});const m=x=>{clearTimeout(_),n!==l.OUTLINE_KEY&&x===l.OUTLINE_KEY?_=setTimeout(()=>o(l.OUTLINE_KEY),500):d(x),o(x)},N=s.useBuilderProp("dataBindingSupport",!1);function y(){const x=setTimeout(()=>{c&&(m(l.OUTLINE_KEY),clearTimeout(c))},500);b(x)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[n!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:y,onClick:()=>m(l.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{m("add-blocks")},size:"sm",variant:n==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m(l.OUTLINE_KEY),size:"sm",variant:n===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m("branding-options"),size:"sm",variant:n==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:x,icon:r})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m(x),size:"sm",className:"w-10",variant:n===x?"default":"outline",children:e.jsxRuntimeExports.jsx(r,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(A,{}),i.Children.toArray(a.map(x=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(x,{})})))]})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-fit border-r bg-background duration-500 ease-in-out ${n!==l.OUTLINE_KEY?"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:I.cn("relative h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1",n===l.OUTLINE_KEY?"":"z-[100]"),onMouseEnter:()=>{c&&clearTimeout(c)},children:i.createElement(u.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:N?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(R.DatabaseIcon,{className:"mr-2 w-3"}),E("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(v?q:T)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(L,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(v?q:T)})]})})})})]})};exports.default=z;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),k=require("@radix-ui/react-icons"),i=require("react"),D=require("jotai"),u=require("lodash-es"),s=require("./index-9PHdn80L.cjs"),R=require("lucide-react"),K=require("@chaibuilder/runtime"),g=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),S=require("./index-0bwkNnA0.cjs"),I=require("./Functions-N3yhPYKY.cjs"),l=require("./MODIFIERS-9EwxLM8V.cjs"),C=require("flagged");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const P=({provider:t,onClose:a})=>{const{t:o}=g.useTranslation(),[n,h]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(c=>h(c))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:d=>d?"":a(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(S.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(w.JsonView,{data:n,shouldExpandNode:w.allExpanded,style:{...w.defaultStyles,container:"max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]})}):null};function O({children:t,name:a,onRemove:o}){const{t:n}=g.useTranslation();return e.jsxRuntimeExports.jsxs(s.AlertDialog,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTrigger,{asChild:!0,children:t}),e.jsxRuntimeExports.jsxs(s.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(s.AlertDialogHeader,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogTitle,{dangerouslySetInnerHTML:{__html:n("remove_provider_confirmation").replace("{name}",a)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:n("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:n("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:o,className:"bg-red-600 hover:bg-red-700",children:n("remove")})]})]})]})}const L=()=>{const{t}=g.useTranslation(),a=i.useMemo(()=>K.getChaiDataProviders(),[]),[o,n]=s.usePageDataProviders(),[,h]=D.useAtom(s.pageSyncStateAtom),[d,c]=i.useState(u.filter(a,r=>u.map(o,"providerKey").includes(r.providerKey))),[b,E]=i.useState(""),[v,f]=i.useState(null),m=u.filter(a.map(r=>u.map(d,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),N=r=>{const p=u.find(a,{providerKey:r});c(j=>[...j,p]),n(j=>[...j,{providerKey:p.providerKey,args:{}}]),E(""),h("UNSAVED")},y=r=>{c(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),n(p=>u.filter(p,j=>j.providerKey!==r.providerKey)),h("UNSAVED")},x=r=>f(r);return u.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(s.Select,{value:b,onValueChange:r=>N(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")}),m.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 ${d.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:d.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:()=>x(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(O,{onRemove:()=>y(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(P,{onClose:()=>f(null),provider:v})]})]})},A=()=>{const{t}=g.useTranslation(),a={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{children:e.jsxRuntimeExports.jsx(s.Button,{size:"sm",className:"w-10",variant:"outline",children:e.jsxRuntimeExports.jsx(k.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(a).map(n=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(n)}),e.jsxRuntimeExports.jsx("div",{children:t(a[n])})]},n))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(n=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(s.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(n)}),e.jsxRuntimeExports.jsx("div",{children:t(o[n])})]},n))})]})})]})]})},U=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-157fSrJX.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./Outline-7CCnnzmK.cjs"))),q=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-gTmusfso.cjs"))),B=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-nwXR9TMl.cjs"))),Y=i.lazy(()=>Promise.resolve().then(()=>require("./index-9PHdn80L.cjs")).then(t=>t.ImagesPanel));let _=null;const z=()=>{const t=s.useBuilderProp("sideBarComponents.top",[]),a=s.useBuilderProp("sideBarComponents.bottom",[]),[o,n]=D.useAtom(s.activePanelAtom),[h,d]=i.useState(o),[c,b]=i.useState(null),{t:E}=g.useTranslation(),v=C.useFeature("arborist"),f={"add-blocks":U,[l.OUTLINE_KEY]:v?q:T,"branding-options":B,images:Y};u.each(t,({name:x,panel:r})=>{f[x]=r});const m=x=>{clearTimeout(_),o!==l.OUTLINE_KEY&&x===l.OUTLINE_KEY?_=setTimeout(()=>n(l.OUTLINE_KEY),500):d(x),n(x)},N=s.useBuilderProp("dataBindingSupport",!1);function y(){const x=setTimeout(()=>{c&&(m(l.OUTLINE_KEY),clearTimeout(c))},500);b(x)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[o!==l.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:y,onClick:()=>m(l.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>{m("add-blocks")},size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m(l.OUTLINE_KEY),size:"sm",variant:o===l.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m("branding-options"),size:"sm",variant:o==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(k.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:x,icon:r})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>m(x),size:"sm",className:"w-10",variant:o===x?"default":"outline",children:e.jsxRuntimeExports.jsx(r,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(A,{}),i.Children.toArray(a.map(x=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(x,{})})))]})]}),e.jsxRuntimeExports.jsx("div",{className:`absolute left-14 z-[50] h-full w-fit min-w-[200px] border-r bg-background duration-500 ease-in-out ${o!==l.OUTLINE_KEY?"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:I.cn("relative h-full max-h-[98%] overflow-y-auto overflow-x-hidden bg-background p-1",o===l.OUTLINE_KEY?"":"z-[100]"),onMouseEnter:()=>{c&&clearTimeout(c)},children:i.createElement(u.get(f,o,()=>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:N?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(R.DatabaseIcon,{className:"mr-2 w-3"}),E("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(v?q:T)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(L,{})})]}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:l.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsx(s.TabsList,{className:"mx-1 grid h-10 grid-cols-1",children:e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:l.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(R.ListTreeIcon,{className:"mr-2 h-3"})," ",E("Outline")]})}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:l.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(v?q:T)})]})})})})]})};exports.default=z;
|
|
@@ -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-9PHdn80L.cjs"),g=require("./controls-KK2oLIa8.cjs"),R=require("./form-n1Q6u16z.cjs"),f=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-9PHdn80L.cjs"),g=require("./controls-KK2oLIa8.cjs"),R=require("./form-n1Q6u16z.cjs"),f=require("./index-nwAgi0aD.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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("./index-0bwkNnA0.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const b=({closeModal:i})=>{var l,o;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(q=>{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("__","_")),{...q,...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||((o=r.slug)==null?void 0:o.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;
|
|
@@ -4,7 +4,7 @@ import { kebabCase as j } from "lodash-es";
|
|
|
4
4
|
import { ae as C, B as u, ad as b, ao as A } from "./index-IPJAbzzO.js";
|
|
5
5
|
import { u as g } from "./controls-OfJWSEqC.js";
|
|
6
6
|
import { F as D } from "./form-Nj6Kdn3g.js";
|
|
7
|
-
import { e as N } from "./index-
|
|
7
|
+
import { e as N } from "./index-_VPpjzJu.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
@@ -41,7 +41,7 @@ import "react-quill";
|
|
|
41
41
|
import "react-i18next";
|
|
42
42
|
import "@rjsf/core";
|
|
43
43
|
import "@rjsf/validator-ajv8";
|
|
44
|
-
import "./index-
|
|
44
|
+
import "./index-UP_4awU9.js";
|
|
45
45
|
import "i18next";
|
|
46
46
|
import "@floating-ui/react-dom";
|
|
47
47
|
import "flagged";
|
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-0bwkNnA0.cjs"),e=require("./index-9PHdn80L.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("jotai");require("flagged");require("react-dnd");require("lodash-es");require("@minoru/react-dnd-treeview");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@radix-ui/react-icons");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-9EwxLM8V.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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,4 +1,4 @@
|
|
|
1
|
-
import { C as J } from "./index-
|
|
1
|
+
import { C as J } from "./index-UP_4awU9.js";
|
|
2
2
|
import { K as N, a9 as Q, L as V, aa as X, M as Y, a8 as _, E as $, F as j, h as ss, u as es, N as os, O as as, P as ts, Q as rs, R as is, U as ps, V as ls, t as ms, W as us, X as ds, Y as cs, Z as Bs, q as ks, J as ns, s as Cs, _ as Ss, z as Ps, a1 as gs, a0 as vs, $ as ys, r as As, a7 as hs, ab as Is, ac as Ms, a2 as Rs, a4 as Us, a3 as Ds, v as bs, a5 as fs, a6 as xs } from "./index-IPJAbzzO.js";
|
|
3
3
|
import { useTranslation as Ts } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./index-IPJAbzzO.js";
|
|
3
|
-
import { h } from "./index-
|
|
3
|
+
import { h } from "./index-_VPpjzJu.js";
|
|
4
4
|
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
@@ -37,7 +37,7 @@ import "react-icons-picker";
|
|
|
37
37
|
import "react-dom";
|
|
38
38
|
import "react-quill";
|
|
39
39
|
import "react-i18next";
|
|
40
|
-
import "./index-
|
|
40
|
+
import "./index-UP_4awU9.js";
|
|
41
41
|
import "i18next";
|
|
42
42
|
import "@floating-ui/react-dom";
|
|
43
43
|
import "flagged";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-9PHdn80L.cjs"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-9PHdn80L.cjs"),l=require("./index-nwAgi0aD.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("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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("./index-0bwkNnA0.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.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;
|
package/dist/email.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-0bwkNnA0.cjs"),r=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-9PHdn80L.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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("@floating-ui/react-dom");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");const q=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],n=i=>{const u={...i,importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:q};return e.jsxRuntimeExports.jsx(t.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=n;
|
package/dist/email.js
CHANGED
|
@@ -203,4 +203,4 @@ object-assign/index.js:
|
|
|
203
203
|
(c) Sindre Sorhus
|
|
204
204
|
@license MIT
|
|
205
205
|
*)
|
|
206
|
-
*/V();var Gge=process.env.NODE_ENV!=="production"?Uge:()=>null;function Hge(){return new URLSearchParams(window.location.search).has("dnd")}function Jge(){return new URLSearchParams(window.location.search).has("outline")}const Yge={dnd:Hge(),arborist:Jge()};class Hk extends f.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?Ae.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[Ae.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),Ae.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const Xge=()=>{const[e,r]=le.usePreviewMode(),{t}=r2.useTranslation(),n=le.useBuilderProp("previewComponent",null);return e?Ae.jsxRuntimeExports.jsxs("div",{className:eR.cn("fixed inset-0 z-[999] bg-background",e?"block":"hidden"),children:[Ae.jsxRuntimeExports.jsxs(le.Button,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>r(!1),children:[Ae.jsxRuntimeExports.jsx(rR.EyeClosedIcon,{}),Ae.jsxRuntimeExports.jsx("span",{children:t("Close Preview")})]}),Ae.jsxRuntimeExports.jsx("div",{children:n?Ae.jsxRuntimeExports.jsx(f.Suspense,{fallback:Ae.jsxRuntimeExports.jsx(le.Skeleton,{className:"h-96 w-full"}),children:f.createElement(n)}):null})]}):null},Qge=()=>{const[e,r]=le.useSelectedBlockIds(),t=le.useRemoveBlocks(),n=le.useDuplicateBlocks(),{undo:a,redo:o}=le.useUndoManager();ra.useHotkeys("esc",()=>r([]),{},[r]),ra.useHotkeys("ctrl+d,command+d",()=>n(e),{preventDefault:!0},[e,n]),ra.useHotkeys("ctrl+z,command+z",()=>a(),{},[a]),ra.useHotkeys("ctrl+y,command+y",()=>o(),{},[o]),ra.useHotkeys("del, backspace",s=>{s.preventDefault(),t(e)},{},[e,t])},_ge=(e,r)=>{const t=[];let n=Yr.find(e,{_id:r}),a=Yr.get(n,"_parent","");for(;Yr.isString(a)&&!Yr.isEmpty(a);)t.push(n==null?void 0:n._parent),n=Yr.find(e,{_id:a}),a=n==null?void 0:n._parent;return Yr.flatten(t)},Jk=Vt.atom([]),$ge=()=>{const[e]=le.useSelectedBlockIds(),r=Vt.useAtomValue(le.presentBlocksAtom),[,t]=Vt.useAtom(Jk);f.useEffect(()=>{let n=[];const a=Yr.first(e);Yr.isString(a)&&(n=[a,..._ge(r,a)]),t(n)},[e,r,t])},eme=()=>Vt.useAtomValue(Jk),Yk=()=>Vt.useAtom(le.chaiExternalDataAtom),rme=()=>f.useMemo(()=>a2.getChaiDataProviders(),[]),tme=({children:e})=>{const[,r]=Yk(),[t]=le.usePageDataProviders(),n=rme();return f.useEffect(()=>(r({}),Yr.each(t,a=>{const o=Yr.find(n,{providerKey:a.providerKey});if(o){const s=(o==null?void 0:o.mockFn)||(o==null?void 0:o.dataFn);s&&s(a.args).then(i=>r(l=>({...l,[a.providerKey]:i})))}}),()=>{Yr.each(t,a=>{r(o=>(delete o[a.providerKey],o))})}),[n,t,r]),Ae.jsxRuntimeExports.jsx(Ae.jsxRuntimeExports.Fragment,{children:e})},nme=f.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-
|
|
206
|
+
*/V();var Gge=process.env.NODE_ENV!=="production"?Uge:()=>null;function Hge(){return new URLSearchParams(window.location.search).has("dnd")}function Jge(){return new URLSearchParams(window.location.search).has("outline")}const Yge={dnd:Hge(),arborist:Jge()};class Hk extends f.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?Ae.jsxRuntimeExports.jsxs("div",{className:"h-full w-full rounded-md bg-red-200 p-4 text-red-500",id:"errorBoundary",children:[Ae.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Oops! Something went wrong."}),Ae.jsxRuntimeExports.jsx("p",{children:"Please try again later."})]}):this.props.children}}const Xge=()=>{const[e,r]=le.usePreviewMode(),{t}=r2.useTranslation(),n=le.useBuilderProp("previewComponent",null);return e?Ae.jsxRuntimeExports.jsxs("div",{className:eR.cn("fixed inset-0 z-[999] bg-background",e?"block":"hidden"),children:[Ae.jsxRuntimeExports.jsxs(le.Button,{size:"sm",className:"absolute right-0 top-0 m-4 space-x-2",onClick:()=>r(!1),children:[Ae.jsxRuntimeExports.jsx(rR.EyeClosedIcon,{}),Ae.jsxRuntimeExports.jsx("span",{children:t("Close Preview")})]}),Ae.jsxRuntimeExports.jsx("div",{children:n?Ae.jsxRuntimeExports.jsx(f.Suspense,{fallback:Ae.jsxRuntimeExports.jsx(le.Skeleton,{className:"h-96 w-full"}),children:f.createElement(n)}):null})]}):null},Qge=()=>{const[e,r]=le.useSelectedBlockIds(),t=le.useRemoveBlocks(),n=le.useDuplicateBlocks(),{undo:a,redo:o}=le.useUndoManager();ra.useHotkeys("esc",()=>r([]),{},[r]),ra.useHotkeys("ctrl+d,command+d",()=>n(e),{preventDefault:!0},[e,n]),ra.useHotkeys("ctrl+z,command+z",()=>a(),{},[a]),ra.useHotkeys("ctrl+y,command+y",()=>o(),{},[o]),ra.useHotkeys("del, backspace",s=>{s.preventDefault(),t(e)},{},[e,t])},_ge=(e,r)=>{const t=[];let n=Yr.find(e,{_id:r}),a=Yr.get(n,"_parent","");for(;Yr.isString(a)&&!Yr.isEmpty(a);)t.push(n==null?void 0:n._parent),n=Yr.find(e,{_id:a}),a=n==null?void 0:n._parent;return Yr.flatten(t)},Jk=Vt.atom([]),$ge=()=>{const[e]=le.useSelectedBlockIds(),r=Vt.useAtomValue(le.presentBlocksAtom),[,t]=Vt.useAtom(Jk);f.useEffect(()=>{let n=[];const a=Yr.first(e);Yr.isString(a)&&(n=[a,..._ge(r,a)]),t(n)},[e,r,t])},eme=()=>Vt.useAtomValue(Jk),Yk=()=>Vt.useAtom(le.chaiExternalDataAtom),rme=()=>f.useMemo(()=>a2.getChaiDataProviders(),[]),tme=({children:e})=>{const[,r]=Yk(),[t]=le.usePageDataProviders(),n=rme();return f.useEffect(()=>(r({}),Yr.each(t,a=>{const o=Yr.find(n,{providerKey:a.providerKey});if(o){const s=(o==null?void 0:o.mockFn)||(o==null?void 0:o.dataFn);s&&s(a.args).then(i=>r(l=>({...l,[a.providerKey]:i})))}}),()=>{Yr.each(t,a=>{r(o=>(delete o[a.providerKey],o))})}),[n,t,r]),Ae.jsxRuntimeExports.jsx(Ae.jsxRuntimeExports.Fragment,{children:e})},nme=f.lazy(()=>Promise.resolve().then(()=>require("./SidePanels-bcJJocSq.cjs"))),ame=f.lazy(()=>Promise.resolve().then(()=>require("./Topbar-NMvzqQHW.cjs"))),ome=f.lazy(()=>Promise.resolve().then(()=>require("./CanvasArea-MmTlc5Vb.cjs"))),sme=f.lazy(()=>Promise.resolve().then(()=>require("./Settings-jHiYmt0y.cjs"))),ime=()=>{const{savePage:e}=le.useSavePage(),r=le.useBuilderProp("autoSaveSupport",!0),t=le.useBuilderProp("autoSaveInterval",60);tR.useIntervalEffect(()=>{r&&e()},t*1e3)},lme=()=>{const[e]=Vt.useAtom(le.pageSyncStateAtom),r=a=>{le.isDevelopment()||a.preventDefault()};Qge(),$ge(),ime(),f.useEffect(()=>(e!=="SAVED"?window.onbeforeunload=()=>"":window.onbeforeunload=null,()=>{window.onbeforeunload=null}),[e]);const t=le.useBuilderProp("editable",!0),n=le.useBuilderProp("nonEditableComponent",null);return Ae.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-background text-foreground",children:Ae.jsxRuntimeExports.jsxs(le.TooltipProvider,{children:[Ae.jsxRuntimeExports.jsxs("div",{onContextMenu:r,className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[Ae.jsxRuntimeExports.jsx("div",{className:"h-14 w-screen shrink-0 border-b border-border",children:Ae.jsxRuntimeExports.jsx(f.Suspense,{children:Ae.jsxRuntimeExports.jsx(ame,{})})}),Ae.jsxRuntimeExports.jsxs("main",{className:"relative flex h-full flex-1 flex-row",children:[t?null:Ae.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 z-[500] flex h-full w-full items-center justify-center backdrop-blur-[2px]",children:Ae.jsxRuntimeExports.jsx(f.Suspense,{children:f.createElement(n)})}),Ae.jsxRuntimeExports.jsx("div",{className:"flex h-full max-h-full w-fit border-border",style:{maxHeight:"calc(100vh - 56px)"},children:Ae.jsxRuntimeExports.jsx(f.Suspense,{children:Ae.jsxRuntimeExports.jsx(nme,{})})}),Ae.jsxRuntimeExports.jsx("div",{className:"h-full flex-1 bg-slate-800/20",children:Ae.jsxRuntimeExports.jsx(f.Suspense,{children:Ae.jsxRuntimeExports.jsx(ome,{})})}),Ae.jsxRuntimeExports.jsx("div",{className:"flex h-[90%] w-[280px] min-w-[280px] border-l border-border pb-10",children:Ae.jsxRuntimeExports.jsx(f.Suspense,{children:Ae.jsxRuntimeExports.jsx(sme,{})})})]})]}),Ae.jsxRuntimeExports.jsx(Xge,{})]})})},$w=Vt.getDefaultStore(),cme=()=>Ae.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen bg-gray-900 py-12 sm:py-16 lg:py-20 xl:hidden",children:Ae.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:Ae.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-md text-center",children:[Ae.jsxRuntimeExports.jsx("img",{src:"https://fldwljgzcktqnysdkxnn.supabase.co/storage/v1/object/public/chaibuilder-blob-storage/175ac8d8-37fe-4707-bb4a-3c0cd6a6db75/gVH7O-Ir_400x400.png",alt:"Chai Builder",className:"mx-auto w-14 rounded-full"}),Ae.jsxRuntimeExports.jsx("br",{}),Ae.jsxRuntimeExports.jsx("h2",{className:"text-4xl font-bold text-white",children:"Screen too small"}),Ae.jsxRuntimeExports.jsx("p",{className:"mt-6 text-sm font-medium leading-6 text-white text-opacity-70",children:"Please view this page on greater than 1280px screen width."})]})})});let Xk=!1;const ume=e=>{Xk=e},dme=(...e)=>{Xk&&console.log(...e)};const fme=e=>{const{dndOptions:r={backend:Dp.MultiBackend,options:Dp.getBackendOptions()}}=e,[,t]=le.useBlocksStore(),[,n]=le.useBrandingOptions(),a=le.useBuilderReset();return f.useEffect(()=>{$w.set(le.chaiBuilderPropsAtom,Yr.omit(e,["blocks","subPages","brandingOptions","dataProviders"]))},[e]),f.useEffect(()=>{$w.set(le.dataProvidersAtom,e.dataProviders||[])},[e.dataProviders]),f.useEffect(()=>{t(a2.syncBlocksWithDefaults(e.blocks||[])),a()},[e.blocks]),f.useEffect(()=>{e2.changeLanguage(e.locale||"en")},[e.locale]),f.useEffect(()=>{ume(e.showDebugLogs)},[e.showDebugLogs]),f.useEffect(()=>{n(e.brandingOptions)},[e.brandingOptions,n]),Ae.jsxRuntimeExports.jsx($k.DndProvider,{...r,children:Ae.jsxRuntimeExports.jsx(lme,{})})},pme=e=>{const r=e._flags||{};return Ae.jsxRuntimeExports.jsxs(Hk,{children:[Ae.jsxRuntimeExports.jsxs(_k.FlagsProvider,{features:{...Yge,...r},children:[Ae.jsxRuntimeExports.jsx(Gge,{}),Ae.jsxRuntimeExports.jsx(cme,{}),Ae.jsxRuntimeExports.jsx(fme,{...e})]}),Ae.jsxRuntimeExports.jsx(le.Toaster,{})]})};exports.BlocksExternalDataProvider=tme;exports.ChaiBuilderEditor=pme;exports.ErrorBoundary=Hk;exports.debugLog=dme;exports.useChaiExternalData=Yk;exports.useExpandedIds=eme;
|
|
@@ -39417,7 +39417,7 @@ const uve = () => {
|
|
|
39417
39417
|
r((o) => (delete o[a.providerKey], o));
|
|
39418
39418
|
});
|
|
39419
39419
|
}), [n, t, r]), /* @__PURE__ */ xe.jsx(xe.Fragment, { children: e });
|
|
39420
|
-
}, vve = $c(() => import("./SidePanels-
|
|
39420
|
+
}, vve = $c(() => import("./SidePanels-OLOUpKn4.js")), hve = $c(() => import("./Topbar-Ny9T-7Zb.js")), bve = $c(() => import("./CanvasArea-MajWGr9z.js")), yve = $c(() => import("./Settings-BhSrj-cE.js")), wve = () => {
|
|
39421
39421
|
const { savePage: e } = VN(), r = Wa("autoSaveSupport", !0), t = Wa("autoSaveInterval", 60);
|
|
39422
39422
|
m6(() => {
|
|
39423
39423
|
r && e();
|
|
@@ -18,7 +18,7 @@ var v2 = (a, t, h, v) => ({
|
|
|
18
18
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
19
19
|
import * as b from "react";
|
|
20
20
|
import H0, { lazy as A2, useCallback as g2, useState as M2, Suspense as u0, useEffect as s0 } from "react";
|
|
21
|
-
import { C as p0 } from "./index-
|
|
21
|
+
import { C as p0 } from "./index-UP_4awU9.js";
|
|
22
22
|
import { FileTextIcon as V0, GearIcon as f0, EyeClosedIcon as m0, EyeOpenIcon as L0 } from "@radix-ui/react-icons";
|
|
23
23
|
import { u as x0, B as Y2, A as w0, a as B0, b as C0, c as O0, d as A0, e as S0, f as y0, g as b0, h as P0 } from "./index-IPJAbzzO.js";
|
|
24
24
|
import { toast as h1, Toaster as F0 } from "sonner";
|
|
@@ -2045,7 +2045,7 @@ const R4 = () => {
|
|
|
2045
2045
|
] })
|
|
2046
2046
|
] })
|
|
2047
2047
|
] });
|
|
2048
|
-
}, I4 = () => /* @__PURE__ */ i.jsx(N4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(j0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), W4 = A2(() => import("./PagesPanel-
|
|
2048
|
+
}, I4 = () => /* @__PURE__ */ i.jsx(N4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(j0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), W4 = A2(() => import("./PagesPanel-pRKHw-AZ.js")), U4 = A2(() => import("./ProjectPanel-iU6DY-Yp.js")), j4 = A2(() => import("./CurrentPage-oPZN6Gwj.js")), Q4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), K4 = () => {
|
|
2049
2049
|
const { mutate: a } = S4();
|
|
2050
2050
|
return P0("editable", !0) ? /* @__PURE__ */ i.jsx(Y2, { onClick: a, className: "bg-blue-600 text-white", children: "Publish" }) : null;
|
|
2051
2051
|
}, G4 = (a) => {
|