@chaibuilder/sdk 1.2.17 → 1.2.19
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-KeHVFaIr.cjs +1 -0
- package/dist/{AddBlocks--SllKzEG.js → AddBlocks-gcTaEIKO.js} +5 -4
- package/dist/BrandingOptions-I2I8w6E9.cjs +1 -0
- package/dist/{BrandingOptions-IqtZrxqX.js → BrandingOptions-bfiFY0VR.js} +11 -10
- package/dist/{CanvasArea-iLUw-tom.cjs → CanvasArea-JfHkTnQD.cjs} +1 -1
- package/dist/{CanvasArea-T1XNnB7d.js → CanvasArea-xvMCbQDL.js} +8 -7
- package/dist/{CurrentPage-TCduhO-X.js → CurrentPage-0Ap2N0uc.js} +13 -12
- package/dist/CurrentPage-vj52UxMA.cjs +1 -0
- package/dist/ListTree-Vq0_s1wC.cjs +1 -0
- package/dist/ListTree-k-QMO740.js +96 -0
- package/dist/{Outline-3IPrK7F-.js → Outline-HI6-c9nf.js} +96 -92
- package/dist/Outline-fAflJ_lN.cjs +1 -0
- package/dist/{PagesPanel-7goyNL8t.js → PagesPanel-Pk-C1956.js} +7 -6
- package/dist/PagesPanel-ug8Tmva6.cjs +1 -0
- package/dist/{ProjectPanel-CdPFwsXg.js → ProjectPanel-_KQBhuPO.js} +8 -7
- package/dist/ProjectPanel-o8-6cPX-.cjs +1 -0
- package/dist/Settings-Cc9eV4VG.cjs +1 -0
- package/dist/{Settings-pva9XRUC.js → Settings-XtAatoiu.js} +5 -4
- package/dist/{SidePanels-u5QXQrWL.js → SidePanels-O52zKXbH.js} +134 -133
- package/dist/SidePanels-ugRobm34.cjs +1 -0
- package/dist/Topbar-e5MGWX9n.cjs +1 -0
- package/dist/{Topbar-S3zgo3N8.js → Topbar-oTx7a12r.js} +5 -4
- package/dist/{UnsplashImages-132gZ842.js → UnsplashImages-5A21uzMK.js} +5 -4
- package/dist/UnsplashImages-KSbKGs91.cjs +1 -0
- package/dist/UploadImages-V42YSRVO.cjs +1 -0
- package/dist/{UploadImages-tr54Ik1I.js → UploadImages-V_54lCAO.js} +5 -4
- package/dist/{add-page-modal-AsP5g0Fp.js → add-page-modal-dKQLw7RQ.js} +17 -16
- package/dist/add-page-modal-xMedOdsp.cjs +1 -0
- package/dist/{confirm-alert-dYoU1ln_.js → confirm-alert-8GP3bKH_.js} +5 -4
- package/dist/{confirm-alert-bw0VBgoG.cjs → confirm-alert-KtW-4OjG.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +3 -2
- package/dist/core.js +47 -46
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
- package/dist/{delete-page-modal-_Hy6ls6b.js → delete-page-modal-Zb5ld6O-.js} +7 -6
- package/dist/delete-page-modal-lebJCBBe.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +79 -79
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +3 -2
- package/dist/email.js +6 -5
- package/dist/{form-jzX2YXUO.cjs → form-o6_55v8F.cjs} +1 -1
- package/dist/{form-f13cs-An.js → form-yyU2x7So.js} +1 -1
- package/dist/{index-4xyhDki2.cjs → index-BMZLAJUV.cjs} +1 -1
- package/dist/{index-0JU8vPT_.cjs → index-JdnF6lYP.cjs} +42 -42
- package/dist/{index-MaXiXghQ.js → index-WP7IRkij.js} +915 -915
- package/dist/{index-ugsWasKp.js → index-lFcrvDFC.js} +3 -3
- package/dist/index-thKfFhmr.cjs +1 -0
- package/dist/{index-eyVVbA05.js → index-yILWlilS.js} +3142 -3132
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-P5Im9RfR.js → page-viewer-3QXwPGpg.js} +11 -10
- package/dist/page-viewer-DTIblLiz.cjs +1 -0
- package/dist/{project-general-setting-R3pVVXmY.js → project-general-setting-UalRmyHm.js} +8 -7
- package/dist/project-general-setting-g7WhM3hc.cjs +1 -0
- package/dist/{project-seo-setting-pGpm3-6U.js → project-seo-setting-8FsvPSPl.js} +6 -5
- package/dist/project-seo-setting-xoeLQVj3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +10 -0
- package/dist/render.js +164 -78
- package/dist/{single-page-detail-m-THVQnz.js → single-page-detail-GaB85dNv.js} +9 -8
- package/dist/single-page-detail-XdBysrE_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +3 -2
- package/dist/studio.js +6 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +140 -139
- package/dist/{useAddBlockByDrop-6qaL4Ufz.cjs → useAddBlockByDrop-6EbioQV4.cjs} +1 -1
- package/dist/{useAddBlockByDrop-vGme3brY.js → useAddBlockByDrop-BIK2fdgj.js} +1 -1
- package/package.json +2 -1
- package/dist/AddBlocks-7TF41ISQ.cjs +0 -1
- package/dist/BrandingOptions-uKE1vuWd.cjs +0 -1
- package/dist/CurrentPage-N5hSL1xB.cjs +0 -1
- package/dist/Outline-g4TXJ-hK.cjs +0 -1
- package/dist/PagesPanel-qI3sijis.cjs +0 -1
- package/dist/ProjectPanel-bMllQ4_a.cjs +0 -1
- package/dist/Settings-8f4ivm4-.cjs +0 -1
- package/dist/SidePanels-7HqZM4-j.cjs +0 -1
- package/dist/Topbar-poeqjjZb.cjs +0 -1
- package/dist/UnsplashImages-BOypn-e5.cjs +0 -1
- package/dist/UploadImages-giiNNHKq.cjs +0 -1
- package/dist/add-page-modal-ajpd-Gmw.cjs +0 -1
- package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
- package/dist/delete-page-modal-H4JOWYZe.cjs +0 -1
- package/dist/index-MQH3blB-.cjs +0 -1
- package/dist/page-viewer-Xj9v8mji.cjs +0 -1
- package/dist/project-general-setting--5DT1RoW.cjs +0 -1
- package/dist/project-seo-setting-3DzzF83_.cjs +0 -1
- package/dist/single-page-detail-nJzGUDym.cjs +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { KeyboardIcon as
|
|
3
|
-
import
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { filter as
|
|
6
|
-
import { ad as
|
|
7
|
-
import { ListTreeIcon as
|
|
8
|
-
import { getChaiDataProviders as
|
|
9
|
-
import { useTranslation as
|
|
10
|
-
import { J as
|
|
11
|
-
import { E as
|
|
12
|
-
import { c as
|
|
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 N } from "react";
|
|
4
|
+
import { useAtom as H } from "jotai";
|
|
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 ye, S as V, au as O, av as I, aw as A, ax as S } from "./index-WP7IRkij.js";
|
|
7
|
+
import { ListTreeIcon as _, DatabaseIcon as Ne } from "lucide-react";
|
|
8
|
+
import { getChaiDataProviders as we } from "@chaibuilder/runtime";
|
|
9
|
+
import { useTranslation as y } from "react-i18next";
|
|
10
|
+
import { J as ke, a as Ce, d as De } from "./index-e0c8PmRQ.js";
|
|
11
|
+
import { E as Te } from "./index-yILWlilS.js";
|
|
12
|
+
import { c as Ae } from "./Functions-7jnEwJyw.js";
|
|
13
13
|
import { O as i } from "./MODIFIERS-WQdaNvb8.js";
|
|
14
|
+
import { useFeature as Se } from "flagged";
|
|
14
15
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
15
|
-
import "flat-to-nested";
|
|
16
16
|
import "@react-hookz/web";
|
|
17
|
+
import "flat-to-nested";
|
|
17
18
|
import "@radix-ui/react-toggle";
|
|
18
19
|
import "class-variance-authority";
|
|
19
20
|
import "./Class-3k8xjeiM.js";
|
|
@@ -40,33 +41,33 @@ import "@radix-ui/react-context-menu";
|
|
|
40
41
|
import "react-icons-picker";
|
|
41
42
|
import "react-dom";
|
|
42
43
|
import "react-quill";
|
|
44
|
+
import "lodash";
|
|
43
45
|
import "i18next";
|
|
44
46
|
import "@floating-ui/react-dom";
|
|
45
47
|
import "react-textarea-autosize";
|
|
46
|
-
import "flagged";
|
|
47
48
|
import "react-dnd";
|
|
48
49
|
import "@minoru/react-dnd-treeview";
|
|
49
50
|
import "react-hotkeys-hook";
|
|
50
|
-
const
|
|
51
|
-
const { t:
|
|
52
|
-
return
|
|
51
|
+
const _e = ({ provider: s, onClose: o }) => {
|
|
52
|
+
const { t: a } = y(), [l, h] = p(null);
|
|
53
|
+
return Z(() => {
|
|
53
54
|
s && (s.mockFn ? s.mockFn : s.dataFn)().then((n) => h(n));
|
|
54
|
-
}, [s]), s ? /* @__PURE__ */ e.jsx(
|
|
55
|
-
/* @__PURE__ */ e.jsxs(
|
|
56
|
-
/* @__PURE__ */ e.jsxs(
|
|
57
|
-
|
|
55
|
+
}, [s]), s ? /* @__PURE__ */ e.jsx(F, { onOpenChange: (c) => c ? "" : o(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(L, { children: [
|
|
56
|
+
/* @__PURE__ */ e.jsxs(R, { children: [
|
|
57
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
58
|
+
a("data_provider"),
|
|
58
59
|
": ",
|
|
59
60
|
s.name
|
|
60
61
|
] }),
|
|
61
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
+
/* @__PURE__ */ e.jsx(se, { children: s.description })
|
|
62
63
|
] }),
|
|
63
|
-
/* @__PURE__ */ e.jsx(
|
|
64
|
-
|
|
64
|
+
/* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsx(
|
|
65
|
+
ke,
|
|
65
66
|
{
|
|
66
|
-
data:
|
|
67
|
-
shouldExpandNode:
|
|
67
|
+
data: l,
|
|
68
|
+
shouldExpandNode: Ce,
|
|
68
69
|
style: {
|
|
69
|
-
...
|
|
70
|
+
...De,
|
|
70
71
|
container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
71
72
|
stringValue: "text-orange-600",
|
|
72
73
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -75,64 +76,64 @@ const Se = ({ provider: s, onClose: o }) => {
|
|
|
75
76
|
) })
|
|
76
77
|
] }) }) : null;
|
|
77
78
|
};
|
|
78
|
-
function
|
|
79
|
+
function Pe({
|
|
79
80
|
children: s,
|
|
80
81
|
name: o,
|
|
81
|
-
onRemove:
|
|
82
|
+
onRemove: a
|
|
82
83
|
}) {
|
|
83
|
-
const { t:
|
|
84
|
-
return /* @__PURE__ */ e.jsxs(
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
84
|
+
const { t: l } = y();
|
|
85
|
+
return /* @__PURE__ */ e.jsxs(re, { children: [
|
|
86
|
+
/* @__PURE__ */ e.jsx(ae, { asChild: !0, children: s }),
|
|
86
87
|
/* @__PURE__ */ e.jsxs(le, { children: [
|
|
87
|
-
/* @__PURE__ */ e.jsxs(
|
|
88
|
+
/* @__PURE__ */ e.jsxs(ie, { children: [
|
|
88
89
|
/* @__PURE__ */ e.jsx(
|
|
89
|
-
|
|
90
|
+
te,
|
|
90
91
|
{
|
|
91
|
-
dangerouslySetInnerHTML: { __html:
|
|
92
|
+
dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", o) }
|
|
92
93
|
}
|
|
93
94
|
),
|
|
94
|
-
/* @__PURE__ */ e.jsx(
|
|
95
|
+
/* @__PURE__ */ e.jsx(oe, { children: l("remove_provider_warning") })
|
|
95
96
|
] }),
|
|
96
|
-
/* @__PURE__ */ e.jsxs(
|
|
97
|
-
/* @__PURE__ */ e.jsx(
|
|
98
|
-
/* @__PURE__ */ e.jsx(
|
|
97
|
+
/* @__PURE__ */ e.jsxs(ne, { children: [
|
|
98
|
+
/* @__PURE__ */ e.jsx(ce, { children: l("cancel") }),
|
|
99
|
+
/* @__PURE__ */ e.jsx(de, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
|
|
99
100
|
] })
|
|
100
101
|
] })
|
|
101
102
|
] });
|
|
102
103
|
}
|
|
103
|
-
const
|
|
104
|
-
const { t: s } =
|
|
105
|
-
|
|
106
|
-
), [k, u] = p(""), [
|
|
107
|
-
o.map((r) =>
|
|
108
|
-
(r) =>
|
|
109
|
-
),
|
|
110
|
-
const x =
|
|
111
|
-
n((m) => [...m, x]),
|
|
112
|
-
},
|
|
113
|
-
n((x) =>
|
|
114
|
-
},
|
|
115
|
-
return
|
|
104
|
+
const Ke = () => {
|
|
105
|
+
const { t: s } = y(), o = $(() => we(), []), [a, l] = me(), [, h] = H(xe), [c, n] = p(
|
|
106
|
+
w(o, (r) => E(a, "providerKey").includes(r.providerKey))
|
|
107
|
+
), [k, u] = p(""), [f, j] = p(null), d = w(
|
|
108
|
+
o.map((r) => E(c, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
|
|
109
|
+
(r) => !G(r)
|
|
110
|
+
), C = (r) => {
|
|
111
|
+
const x = Q(o, { providerKey: r });
|
|
112
|
+
n((m) => [...m, x]), l((m) => [...m, { providerKey: x.providerKey, args: {} }]), u(""), h("UNSAVED");
|
|
113
|
+
}, D = (r) => {
|
|
114
|
+
n((x) => w(x, (m) => m.providerKey !== r.providerKey)), l((x) => w(x, (m) => m.providerKey !== r.providerKey)), h("UNSAVED");
|
|
115
|
+
}, t = (r) => j(r);
|
|
116
|
+
return W(o) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
116
117
|
s("no_data_providers"),
|
|
117
118
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
118
119
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
|
|
119
120
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
120
121
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
121
122
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
|
|
122
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
123
|
-
/* @__PURE__ */ e.jsx(
|
|
124
|
-
/* @__PURE__ */ e.jsxs(
|
|
125
|
-
/* @__PURE__ */ e.jsx(
|
|
126
|
-
|
|
123
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(pe, { value: k, onValueChange: (r) => C(r), children: [
|
|
124
|
+
/* @__PURE__ */ e.jsx(he, { className: "w-full", children: /* @__PURE__ */ e.jsx(ue, { placeholder: s("select_provider") }) }),
|
|
125
|
+
/* @__PURE__ */ e.jsxs(fe, { children: [
|
|
126
|
+
/* @__PURE__ */ e.jsx(B, { value: "", children: s("choose") }),
|
|
127
|
+
d.map((r) => /* @__PURE__ */ e.jsx(B, { value: r.value, children: r.label }, r.value))
|
|
127
128
|
] })
|
|
128
129
|
] }) }),
|
|
129
130
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
130
|
-
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${
|
|
131
|
+
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${c.length ? "block" : "hidden"}`, children: [
|
|
131
132
|
/* @__PURE__ */ e.jsxs("p", { className: "flex-1 pb-1.5 pt-4 text-xs font-medium text-gray-500", children: [
|
|
132
133
|
s("page_data_providers"),
|
|
133
134
|
":"
|
|
134
135
|
] }),
|
|
135
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children:
|
|
136
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: c.map((r) => /* @__PURE__ */ e.jsxs(
|
|
136
137
|
"div",
|
|
137
138
|
{
|
|
138
139
|
className: "w-full rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
@@ -146,7 +147,7 @@ const Ae = () => {
|
|
|
146
147
|
/* @__PURE__ */ e.jsxs(
|
|
147
148
|
"button",
|
|
148
149
|
{
|
|
149
|
-
onClick: () =>
|
|
150
|
+
onClick: () => t(r),
|
|
150
151
|
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",
|
|
151
152
|
children: [
|
|
152
153
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -172,7 +173,7 @@ const Ae = () => {
|
|
|
172
173
|
]
|
|
173
174
|
}
|
|
174
175
|
),
|
|
175
|
-
/* @__PURE__ */ e.jsx(
|
|
176
|
+
/* @__PURE__ */ e.jsx(Pe, { onRemove: () => D(r), name: r.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
|
|
176
177
|
/* @__PURE__ */ e.jsxs(
|
|
177
178
|
"svg",
|
|
178
179
|
{
|
|
@@ -200,126 +201,126 @@ const Ae = () => {
|
|
|
200
201
|
},
|
|
201
202
|
r.providerKey
|
|
202
203
|
)) }),
|
|
203
|
-
/* @__PURE__ */ e.jsx(
|
|
204
|
+
/* @__PURE__ */ e.jsx(_e, { onClose: () => j(null), provider: f })
|
|
204
205
|
] })
|
|
205
206
|
] });
|
|
206
|
-
},
|
|
207
|
-
const { t: s } =
|
|
207
|
+
}, Ee = () => {
|
|
208
|
+
const { t: s } = y(), o = {
|
|
208
209
|
"ctrl + Z": "Undo",
|
|
209
210
|
"ctrl + Y": "Redo",
|
|
210
211
|
"ctrl + D": "Duplicate"
|
|
211
|
-
},
|
|
212
|
+
}, a = {
|
|
212
213
|
// "ctrl + /": "Rename block",
|
|
213
214
|
"ctrl + S": "Save page",
|
|
214
215
|
esc: "Deselect blocks",
|
|
215
216
|
del: "Delete block"
|
|
216
217
|
};
|
|
217
|
-
return /* @__PURE__ */ e.jsxs(
|
|
218
|
-
/* @__PURE__ */ e.jsx(
|
|
219
|
-
/* @__PURE__ */ e.jsx(
|
|
220
|
-
/* @__PURE__ */ e.jsx(
|
|
218
|
+
return /* @__PURE__ */ e.jsxs(F, { children: [
|
|
219
|
+
/* @__PURE__ */ e.jsx(je, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
220
|
+
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx(g, { size: "sm", className: "w-10", variant: "outline", children: /* @__PURE__ */ e.jsx(J, {}) }) }),
|
|
221
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
|
|
221
222
|
] }) }),
|
|
222
|
-
/* @__PURE__ */ e.jsxs(
|
|
223
|
-
/* @__PURE__ */ e.jsx(
|
|
223
|
+
/* @__PURE__ */ e.jsxs(L, { className: "sm:max-w-[525px]", children: [
|
|
224
|
+
/* @__PURE__ */ e.jsx(R, { children: /* @__PURE__ */ e.jsx(U, { children: s("Keyboard shortcuts") }) }),
|
|
224
225
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
|
|
225
|
-
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((
|
|
226
|
-
/* @__PURE__ */ e.jsx(
|
|
227
|
-
/* @__PURE__ */ e.jsx("div", { children: s(o[
|
|
228
|
-
] })) }),
|
|
229
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(
|
|
230
|
-
/* @__PURE__ */ e.jsx(
|
|
231
|
-
/* @__PURE__ */ e.jsx("div", { children: s(l
|
|
226
|
+
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(o).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
227
|
+
/* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
|
|
228
|
+
/* @__PURE__ */ e.jsx("div", { children: s(o[l]) })
|
|
229
|
+
] }, l)) }),
|
|
230
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(a).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
231
|
+
/* @__PURE__ */ e.jsx(z, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
|
|
232
|
+
/* @__PURE__ */ e.jsx("div", { children: s(a[l]) })
|
|
232
233
|
] })) })
|
|
233
234
|
] }) })
|
|
234
235
|
] })
|
|
235
236
|
] });
|
|
236
|
-
},
|
|
237
|
-
let
|
|
238
|
-
const
|
|
239
|
-
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [
|
|
240
|
-
"add-blocks":
|
|
241
|
-
[i]: P,
|
|
242
|
-
"branding-options":
|
|
243
|
-
images:
|
|
237
|
+
}, Be = b(() => import("./AddBlocks-gcTaEIKO.js")), P = b(() => import("./Outline-HI6-c9nf.js")), K = b(() => import("./ListTree-k-QMO740.js")), ze = b(() => import("./BrandingOptions-bfiFY0VR.js")), Ve = b(() => import("./index-WP7IRkij.js").then((s) => s.cq));
|
|
238
|
+
let M = null;
|
|
239
|
+
const Es = () => {
|
|
240
|
+
const s = T("sideBarComponents.top", []), o = T("sideBarComponents.bottom", []), [a, l] = H(ye), [h, c] = p(a), [n, k] = p(null), { t: u } = y(), f = Se("arborist"), j = {
|
|
241
|
+
"add-blocks": Be,
|
|
242
|
+
[i]: f ? K : P,
|
|
243
|
+
"branding-options": ze,
|
|
244
|
+
images: Ve
|
|
244
245
|
};
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
X(s, ({ name: t, panel: r }) => {
|
|
247
|
+
j[t] = r;
|
|
247
248
|
});
|
|
248
|
-
const
|
|
249
|
-
clearTimeout(
|
|
249
|
+
const d = (t) => {
|
|
250
|
+
clearTimeout(M), a !== i && t === i ? M = setTimeout(() => l(i), 500) : c(t), l(t);
|
|
250
251
|
}, C = T("dataBindingSupport", !1);
|
|
251
252
|
function D() {
|
|
252
253
|
const t = setTimeout(() => {
|
|
253
|
-
n && (
|
|
254
|
+
n && (d(i), clearTimeout(n));
|
|
254
255
|
}, 500);
|
|
255
256
|
k(t);
|
|
256
257
|
}
|
|
257
258
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
258
|
-
|
|
259
|
+
a !== i ? /* @__PURE__ */ e.jsx(
|
|
259
260
|
"div",
|
|
260
261
|
{
|
|
261
262
|
onMouseEnter: D,
|
|
262
|
-
onClick: () =>
|
|
263
|
+
onClick: () => d(i),
|
|
263
264
|
className: "fixed inset-0 z-[50] bg-black/20"
|
|
264
265
|
}
|
|
265
266
|
) : null,
|
|
266
267
|
/* @__PURE__ */ e.jsxs("div", { className: "z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2", children: [
|
|
267
268
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
|
|
268
269
|
/* @__PURE__ */ e.jsx(
|
|
269
|
-
|
|
270
|
+
g,
|
|
270
271
|
{
|
|
271
272
|
onClick: () => {
|
|
272
|
-
|
|
273
|
+
d("add-blocks");
|
|
273
274
|
},
|
|
274
275
|
size: "sm",
|
|
275
|
-
variant:
|
|
276
|
-
children: /* @__PURE__ */ e.jsx(
|
|
276
|
+
variant: a === "add-blocks" ? "default" : "outline",
|
|
277
|
+
children: /* @__PURE__ */ e.jsx(q, { className: "text-xl" })
|
|
277
278
|
}
|
|
278
279
|
),
|
|
279
280
|
/* @__PURE__ */ e.jsx(
|
|
280
|
-
|
|
281
|
+
g,
|
|
281
282
|
{
|
|
282
|
-
onClick: () =>
|
|
283
|
+
onClick: () => d(i),
|
|
283
284
|
size: "sm",
|
|
284
|
-
variant:
|
|
285
|
-
children: /* @__PURE__ */ e.jsx(
|
|
285
|
+
variant: a === i ? "default" : "outline",
|
|
286
|
+
children: /* @__PURE__ */ e.jsx(_, { className: "w-4" })
|
|
286
287
|
}
|
|
287
288
|
),
|
|
288
289
|
/* @__PURE__ */ e.jsx(
|
|
289
|
-
|
|
290
|
+
g,
|
|
290
291
|
{
|
|
291
|
-
onClick: () =>
|
|
292
|
+
onClick: () => d("branding-options"),
|
|
292
293
|
size: "sm",
|
|
293
|
-
variant:
|
|
294
|
-
children: /* @__PURE__ */ e.jsx(
|
|
294
|
+
variant: a === "branding-options" ? "default" : "outline",
|
|
295
|
+
children: /* @__PURE__ */ e.jsx(Y, { className: "w-4 max-w-[40px] text-xs" })
|
|
295
296
|
}
|
|
296
297
|
),
|
|
297
|
-
|
|
298
|
-
s.map(({ name: t, icon:
|
|
299
|
-
|
|
298
|
+
v.Children.toArray(
|
|
299
|
+
s.map(({ name: t, icon: r }) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
300
|
+
g,
|
|
300
301
|
{
|
|
301
|
-
onClick: () =>
|
|
302
|
+
onClick: () => d(t),
|
|
302
303
|
size: "sm",
|
|
303
304
|
className: "w-10",
|
|
304
|
-
variant:
|
|
305
|
-
children: /* @__PURE__ */ e.jsx(
|
|
305
|
+
variant: a === t ? "default" : "outline",
|
|
306
|
+
children: /* @__PURE__ */ e.jsx(r, {})
|
|
306
307
|
}
|
|
307
308
|
) }))
|
|
308
309
|
)
|
|
309
310
|
] }),
|
|
310
311
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
311
|
-
/* @__PURE__ */ e.jsx(
|
|
312
|
-
|
|
313
|
-
o.map((t) => /* @__PURE__ */ e.jsx(
|
|
312
|
+
/* @__PURE__ */ e.jsx(Ee, {}),
|
|
313
|
+
v.Children.toArray(
|
|
314
|
+
o.map((t) => /* @__PURE__ */ e.jsx(N, { fallback: /* @__PURE__ */ e.jsx(V, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(t, {}) }))
|
|
314
315
|
)
|
|
315
316
|
] })
|
|
316
317
|
] }),
|
|
317
318
|
/* @__PURE__ */ e.jsx(
|
|
318
319
|
"div",
|
|
319
320
|
{
|
|
320
|
-
className: `absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${
|
|
321
|
+
className: `absolute left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${a !== i ? "translate-x-0" : "-translate-x-full"}`,
|
|
321
322
|
children: /* @__PURE__ */ e.jsx(
|
|
322
|
-
|
|
323
|
+
N,
|
|
323
324
|
{
|
|
324
325
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
|
|
325
326
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -329,14 +330,14 @@ const As = () => {
|
|
|
329
330
|
children: /* @__PURE__ */ e.jsx(
|
|
330
331
|
"div",
|
|
331
332
|
{
|
|
332
|
-
className:
|
|
333
|
+
className: Ae(
|
|
333
334
|
"relative h-full max-h-[93%] overflow-y-auto overflow-x-hidden bg-background p-1",
|
|
334
|
-
|
|
335
|
+
a === i ? "" : "z-[100]"
|
|
335
336
|
),
|
|
336
337
|
onMouseEnter: () => {
|
|
337
338
|
n && clearTimeout(n);
|
|
338
339
|
},
|
|
339
|
-
children:
|
|
340
|
+
children: v.createElement(ee(j, a, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
340
341
|
}
|
|
341
342
|
)
|
|
342
343
|
}
|
|
@@ -344,39 +345,39 @@ const As = () => {
|
|
|
344
345
|
}
|
|
345
346
|
),
|
|
346
347
|
/* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
|
|
347
|
-
|
|
348
|
+
N,
|
|
348
349
|
{
|
|
349
350
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
|
|
350
351
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
351
352
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
352
353
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
353
354
|
] }),
|
|
354
|
-
children: C ? /* @__PURE__ */ e.jsxs(
|
|
355
|
-
/* @__PURE__ */ e.jsxs(
|
|
356
|
-
/* @__PURE__ */ e.jsxs(
|
|
357
|
-
/* @__PURE__ */ e.jsx(
|
|
355
|
+
children: C ? /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
356
|
+
/* @__PURE__ */ e.jsxs(I, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
357
|
+
/* @__PURE__ */ e.jsxs(A, { value: i, children: [
|
|
358
|
+
/* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
|
|
358
359
|
" ",
|
|
359
360
|
u("Outline")
|
|
360
361
|
] }),
|
|
361
|
-
/* @__PURE__ */ e.jsxs(
|
|
362
|
-
/* @__PURE__ */ e.jsx(
|
|
362
|
+
/* @__PURE__ */ e.jsxs(A, { value: "data-provider", children: [
|
|
363
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "mr-2 w-3" }),
|
|
363
364
|
u("Data")
|
|
364
365
|
] })
|
|
365
366
|
] }),
|
|
366
|
-
/* @__PURE__ */ e.jsx(
|
|
367
|
-
/* @__PURE__ */ e.jsx(
|
|
368
|
-
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
369
|
-
/* @__PURE__ */ e.jsx(
|
|
370
|
-
/* @__PURE__ */ e.jsx(
|
|
367
|
+
/* @__PURE__ */ e.jsx(S, { value: i, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: v.createElement(f ? K : P) }),
|
|
368
|
+
/* @__PURE__ */ e.jsx(S, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ke, {}) })
|
|
369
|
+
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(O, { defaultValue: i, className: "flex h-full w-full flex-col py-1", children: [
|
|
370
|
+
/* @__PURE__ */ e.jsx(I, { className: "mx-1 grid h-10 grid-cols-1", children: /* @__PURE__ */ e.jsxs(A, { value: i, children: [
|
|
371
|
+
/* @__PURE__ */ e.jsx(_, { className: "mr-2 h-3" }),
|
|
371
372
|
" ",
|
|
372
373
|
u("Outline")
|
|
373
374
|
] }) }),
|
|
374
375
|
/* @__PURE__ */ e.jsx(
|
|
375
|
-
|
|
376
|
+
S,
|
|
376
377
|
{
|
|
377
378
|
value: i,
|
|
378
379
|
className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",
|
|
379
|
-
children:
|
|
380
|
+
children: v.createElement(f ? K : P)
|
|
380
381
|
}
|
|
381
382
|
)
|
|
382
383
|
] }) })
|
|
@@ -385,5 +386,5 @@ const As = () => {
|
|
|
385
386
|
] });
|
|
386
387
|
};
|
|
387
388
|
export {
|
|
388
|
-
|
|
389
|
+
Es as default
|
|
389
390
|
};
|
|
@@ -0,0 +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-thKfFhmr.cjs"),R=require("lucide-react"),K=require("@chaibuilder/runtime"),g=require("react-i18next"),w=require("./index-gi1LIOCw.cjs"),S=require("./index-JdnF6lYP.cjs"),I=require("./Functions-N3yhPYKY.cjs"),l=require("./MODIFIERS-9EwxLM8V.cjs"),C=require("flagged");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@react-hookz/web");require("flat-to-nested");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("lodash");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");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-KeHVFaIr.cjs"))),T=i.lazy(()=>Promise.resolve().then(()=>require("./Outline-fAflJ_lN.cjs"))),q=i.lazy(()=>Promise.resolve().then(()=>require("./ListTree-Vq0_s1wC.cjs"))),B=i.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-I2I8w6E9.cjs"))),Y=i.lazy(()=>Promise.resolve().then(()=>require("./index-thKfFhmr.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-96 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-[93%] 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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),h=require("@radix-ui/react-icons"),t=require("./index-thKfFhmr.cjs"),z=require("./index-ecnGWzh9.cjs"),i=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("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");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("lodash");const v=()=>t.useBuilderProp("languages",["en"]),g=()=>v().length===1?null:c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:c.jsxRuntimeExports.jsxs(t.Select,{children:[c.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"w-[150px] border-0",children:c.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:c.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[c.jsxRuntimeExports.jsx(h.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),c.jsxRuntimeExports.jsx(t.SelectContent,{children:c.jsxRuntimeExports.jsxs(t.SelectGroup,{children:[c.jsxRuntimeExports.jsx(t.SelectLabel,{children:"Fruits"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"apple",children:"Apple"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"banana",children:"Banana"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"blueberry",children:"Blueberry"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"grapes",children:"Grapes"}),c.jsxRuntimeExports.jsx(t.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})});function H(l){return z.GenIcon({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"}}]})(l)}const V=()=>{const{savePage:l,syncState:a}=t.useSavePage(),{t:s}=i.useTranslation(),e=r.useMemo(()=>{switch(a){case"SAVING":return"animate-pulse bg-gray-300 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[a]),n=c.jsxRuntimeExports.jsxs(t.Button,{disabled:a==="SAVING",onClick:o=>{o.preventDefault(),l()},className:`flex h-auto w-fit items-center gap-x-2 rounded-full p-1.5 px-3 ${e}`,size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(H,{className:"text-lg"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:a==="SAVING"?"Saving...":s(a==="SAVED"?"Saved":"Unsaved")})]});return c.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:n})},M=function(){const a=t.useBuilderProp("previewComponent"),[,s]=t.usePreviewMode(),{t:e}=i.useTranslation();return a?c.jsxRuntimeExports.jsxs(t.Button,{onClick:n=>{n.preventDefault(),s(!0)},className:"flex h-auto w-fit items-center gap-x-2 rounded-full bg-gray-200 px-3 py-1",size:"sm",variant:"outline",children:[c.jsxRuntimeExports.jsx(h.EyeOpenIcon,{className:"text-xs"}),c.jsxRuntimeExports.jsx("span",{className:"text-sm",children:e("Preview")})]}):null},u=()=>{const l=t.useBuilderProp("topBarComponents.left",[]),a=t.useBuilderProp("topBarComponents.center",[]),s=t.useBuilderProp("topBarComponents.right",[]),e=t.useBuilderProp("editable",!0);return c.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:r.Children.toArray(l.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))})}),c.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:r.Children.toArray(a.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))}),c.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsxRuntimeExports.jsx(g,{}),c.jsxRuntimeExports.jsx(M,{}),c.jsxRuntimeExports.jsx(t.Separator,{orientation:"vertical"}),e?c.jsxRuntimeExports.jsx(V,{}):null,r.Children.toArray(s.map(n=>c.jsxRuntimeExports.jsx(r.Suspense,{fallback:c.jsxRuntimeExports.jsx(t.Skeleton,{className:"h-10"}),children:c.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import z, { useMemo as V, Suspense as n } from "react";
|
|
3
3
|
import { FontFamilyIcon as o, EyeOpenIcon as M } from "@radix-ui/react-icons";
|
|
4
|
-
import { h as s, aj as u, ak as d, al as C, am as L, ay as m, az as p, an as i, z as F, B as g, q as w, S as v, aA as B } from "./index-
|
|
4
|
+
import { h as s, aj as u, ak as d, al as C, am as L, ay as m, az as p, an as i, z as F, B as g, q as w, S as v, aA as B } from "./index-WP7IRkij.js";
|
|
5
5
|
import { G as f } from "./index-YpnaudSM.js";
|
|
6
6
|
import { useTranslation as e } from "react-i18next";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -11,9 +11,9 @@ import "clsx";
|
|
|
11
11
|
import "tailwind-merge";
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
|
-
import "flat-to-nested";
|
|
15
14
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
15
|
import "@react-hookz/web";
|
|
16
|
+
import "flat-to-nested";
|
|
17
17
|
import "@radix-ui/react-toggle";
|
|
18
18
|
import "class-variance-authority";
|
|
19
19
|
import "./Class-3k8xjeiM.js";
|
|
@@ -38,6 +38,7 @@ import "@radix-ui/react-context-menu";
|
|
|
38
38
|
import "react-icons-picker";
|
|
39
39
|
import "react-dom";
|
|
40
40
|
import "react-quill";
|
|
41
|
+
import "lodash";
|
|
41
42
|
const x = () => s("languages", ["en"]), S = () => x().length === 1 ? null : /* @__PURE__ */ c.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ c.jsxs(u, { children: [
|
|
42
43
|
/* @__PURE__ */ c.jsx(d, { className: "w-[150px] border-0", children: /* @__PURE__ */ c.jsx(
|
|
43
44
|
C,
|
|
@@ -104,7 +105,7 @@ const R = () => {
|
|
|
104
105
|
]
|
|
105
106
|
}
|
|
106
107
|
) : null;
|
|
107
|
-
},
|
|
108
|
+
}, C1 = () => {
|
|
108
109
|
const l = s("topBarComponents.left", []), t = s("topBarComponents.center", []), r = s("topBarComponents.right", []), h = s("editable", !0);
|
|
109
110
|
return /* @__PURE__ */ c.jsxs("div", { className: "flex h-14 items-center justify-between px-2", children: [
|
|
110
111
|
/* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ c.jsx("div", { className: "flex items-center space-x-2 font-bold", children: z.Children.toArray(
|
|
@@ -125,5 +126,5 @@ const R = () => {
|
|
|
125
126
|
] });
|
|
126
127
|
};
|
|
127
128
|
export {
|
|
128
|
-
|
|
129
|
+
C1 as default
|
|
129
130
|
};
|
|
@@ -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 V } from "unsplash-js";
|
|
6
|
-
import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h, bg as Q, B as H } from "./index-
|
|
6
|
+
import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h, bg as Q, B as H } from "./index-WP7IRkij.js";
|
|
7
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
8
|
import { Loader as W } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -12,8 +12,8 @@ import "clsx";
|
|
|
12
12
|
import "tailwind-merge";
|
|
13
13
|
import "@chaibuilder/runtime";
|
|
14
14
|
import "jotai";
|
|
15
|
-
import "flat-to-nested";
|
|
16
15
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
|
+
import "flat-to-nested";
|
|
17
17
|
import "@radix-ui/react-toggle";
|
|
18
18
|
import "class-variance-authority";
|
|
19
19
|
import "./Class-3k8xjeiM.js";
|
|
@@ -38,12 +38,13 @@ import "@radix-ui/react-context-menu";
|
|
|
38
38
|
import "react-icons-picker";
|
|
39
39
|
import "react-dom";
|
|
40
40
|
import "react-quill";
|
|
41
|
+
import "lodash";
|
|
41
42
|
import "react-i18next";
|
|
42
43
|
const I = async (x, g) => new Promise((o, r) => {
|
|
43
44
|
V({ accessKey: g }).search.getPhotos(x).then((i) => {
|
|
44
45
|
o(i);
|
|
45
46
|
}).catch((i) => r(i));
|
|
46
|
-
}),
|
|
47
|
+
}), Ee = ({ isModalView: x, onSelect: g }) => {
|
|
47
48
|
const o = B("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
48
49
|
if (d(u))
|
|
49
50
|
return;
|
|
@@ -193,6 +194,6 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
193
194
|
] });
|
|
194
195
|
};
|
|
195
196
|
export {
|
|
196
|
-
|
|
197
|
+
Ee as default,
|
|
197
198
|
I as fetchImage
|
|
198
199
|
};
|