@chaibuilder/sdk 1.2.64 → 1.2.66
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-Mm5byzEC.js +124 -0
- package/dist/AddBlocks-jaxiAG4L.cjs +1 -0
- package/dist/CanvasArea-8NXGRRYC.js +137 -0
- package/dist/CanvasArea-SkeoJz9W.cjs +1 -0
- package/dist/{CodeEditor-37od44Ou.js → CodeEditor-3l-mFvg4.js} +61 -46
- package/dist/CodeEditor-o-CkvDnY.cjs +1 -0
- package/dist/STRINGS--j49GZJP.js +7 -0
- package/dist/STRINGS-gPz7CUOk.cjs +1 -0
- package/dist/SettingsPanel-2uYGx-MQ.cjs +1 -0
- package/dist/SettingsPanel-Q3xQQm81.js +82 -0
- package/dist/{SidePanels-UQj0XTnb.js → SidePanels-JyziIpDA.js} +125 -116
- package/dist/SidePanels-d04PONzN.cjs +1 -0
- package/dist/{Topbar-1O05wogM.js → Topbar-Xgd6YI66.js} +68 -57
- package/dist/Topbar-eIenyfZu.cjs +1 -0
- package/dist/UILibrariesPanel-ADjJse3_.cjs +1 -0
- package/dist/{UILibrariesPanel-vshiYI6G.js → UILibrariesPanel-a7TrMuAU.js} +98 -86
- package/dist/{UnsplashImages-Eq7hprBO.js → UnsplashImages-6Bj8nQ8n.js} +65 -49
- package/dist/UnsplashImages-hLdMtY12.cjs +1 -0
- package/dist/{UploadImages-lco2Tea3.js → UploadImages-4PxhlZMB.js} +58 -44
- package/dist/UploadImages-uL2R7fju.cjs +1 -0
- package/dist/badge-7BVT3zxN.cjs +1 -0
- package/dist/badge-pJqQSA13.js +23 -0
- package/dist/context-menu-_8TFbFEJ.cjs +1 -0
- package/dist/context-menu-sks9vdzC.js +906 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +45 -21
- package/dist/core.js +93 -79
- package/dist/iconBase-vJD0OXxU.cjs +1 -0
- package/dist/iconBase-zweRWSz0.js +323 -0
- package/dist/index-Dgo2PNEV.js +33210 -0
- package/dist/index-jhNzBWrV.cjs +223 -0
- package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
- package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
- package/dist/plugin-P0tpo_XZ.cjs +1 -0
- package/dist/plugin-_F-KZp1i.cjs +1 -0
- package/dist/plugin-f5uJtdXY.js +43 -0
- package/dist/plugin-sJ3Hzvpv.js +57 -0
- package/dist/render.cjs +3 -1
- package/dist/render.d.ts +19 -52
- package/dist/render.js +136 -183
- package/dist/select-JW3OMYm-.js +75 -0
- package/dist/select-fXj5tdMX.cjs +1 -0
- package/dist/separator-hT24N-xp.cjs +1 -0
- package/dist/separator-sgwOa1FE.js +18 -0
- package/dist/style.css +2 -2
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.d.ts +41 -1
- package/dist/tailwind.js +16 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +0 -10
- package/dist/ui.js +345 -163
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +1 -1
- package/dist/web-blocks.js +489 -724
- package/package.json +15 -45
- package/dist/AddBlocks-6dJmFSgk.js +0 -142
- package/dist/AddBlocks-doCNVVbk.cjs +0 -1
- package/dist/CanvasArea-kB6ky_uL.js +0 -164
- package/dist/CanvasArea-kdnkFfKR.cjs +0 -1
- package/dist/CodeEditor-ypUx3RAV.cjs +0 -1
- package/dist/CurrentPage-Ekl5Cwbv.cjs +0 -1
- package/dist/CurrentPage-bHq9Uusr.js +0 -108
- package/dist/Functions-7jnEwJyw.js +0 -15
- package/dist/Functions-N3yhPYKY.cjs +0 -1
- package/dist/MODIFIERS-fd5XOmum.js +0 -60
- package/dist/MODIFIERS-mVmfEGgo.cjs +0 -1
- package/dist/PagesPanel-SMHrEmCb.cjs +0 -1
- package/dist/PagesPanel-wIPAyjJK.js +0 -66
- package/dist/ProjectPanel-L-SlDizV.js +0 -87
- package/dist/ProjectPanel-YruLal65.cjs +0 -1
- package/dist/Settings-WXkCyhAv.js +0 -2380
- package/dist/Settings-_5VHcgFC.cjs +0 -1
- package/dist/SidePanels-UeIZB3e1.cjs +0 -1
- package/dist/StaticCanvas-7C52tXAv.js +0 -749
- package/dist/StaticCanvas-ll9VTXI5.cjs +0 -60
- package/dist/ThemeConfigPanel-_86vVxLz.cjs +0 -1
- package/dist/ThemeConfigPanel-gw8B2zvx.js +0 -194
- package/dist/Topbar-gb17oHdJ.cjs +0 -1
- package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
- package/dist/UnsplashImages-6UjgojvF.cjs +0 -1
- package/dist/UploadImages-3h0cRsvr.cjs +0 -1
- package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
- package/dist/add-page-modal-qr7rvJzN.js +0 -106
- package/dist/add-page-modal-rOKavDFX.cjs +0 -1
- package/dist/atoms-KQpaDRnF.cjs +0 -1
- package/dist/atoms-Oomqut88.js +0 -6
- package/dist/confirm-alert-P6TAevaP.js +0 -60
- package/dist/confirm-alert-v1lG8ex4.cjs +0 -1
- package/dist/controls-rRZhz0vu.cjs +0 -1
- package/dist/controls-yjgoZzB6.js +0 -199
- package/dist/delete-page-modal-55oioI9i.js +0 -85
- package/dist/delete-page-modal-wdAiMVnL.cjs +0 -1
- package/dist/email-blocks.cjs +0 -1
- package/dist/email-blocks.d.ts +0 -3
- package/dist/email-blocks.js +0 -294
- package/dist/email.cjs +0 -1
- package/dist/email.d.ts +0 -171
- package/dist/email.js +0 -75
- package/dist/empty-slot-Lsxjts7Q.js +0 -6
- package/dist/empty-slot-Sy930lX6.cjs +0 -1
- package/dist/form-4jTocVbZ.cjs +0 -1
- package/dist/form-5ke_lZv8.js +0 -125
- package/dist/functions--tdNWQDW.js +0 -30
- package/dist/functions-EVUeSwX1.cjs +0 -1
- package/dist/html-to-json-_01DXd-a.js +0 -192
- package/dist/html-to-json-ndxaXRT8.cjs +0 -1
- package/dist/index--mLLy7QQ.cjs +0 -1
- package/dist/index-6w-6HYBd.cjs +0 -1
- package/dist/index-VBXQixVm.js +0 -117
- package/dist/index-aeDphKpP.cjs +0 -1
- package/dist/index-audsIPBC.cjs +0 -231
- package/dist/index-b33n_-zO.js +0 -3141
- package/dist/index-e0c8PmRQ.js +0 -205
- package/dist/index-fnkMn4Pk.js +0 -2201
- package/dist/index-gi1LIOCw.cjs +0 -1
- package/dist/index-wRAIA8zZ.js +0 -80248
- package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
- package/dist/lib.cjs +0 -3
- package/dist/lib.d.ts +0 -80
- package/dist/lib.js +0 -1350
- package/dist/page-viewer-t44DP65U.js +0 -112
- package/dist/page-viewer-wU7T0f48.cjs +0 -1
- package/dist/plugin-2hf9pCRy.cjs +0 -1
- package/dist/plugin-wDnsBVPp.js +0 -54
- package/dist/project-general-setting-87cX9vvO.cjs +0 -1
- package/dist/project-general-setting-NEkNjf7V.js +0 -81
- package/dist/project-seo-setting-YmspOYsF.js +0 -83
- package/dist/project-seo-setting-o0V9acCV.cjs +0 -1
- package/dist/server.cjs +0 -1
- package/dist/server.d.ts +0 -299
- package/dist/server.js +0 -216
- package/dist/single-page-detail-27UjWK8L.cjs +0 -1
- package/dist/single-page-detail-jHzoDP7B.js +0 -220
- package/dist/studio.cjs +0 -1
- package/dist/studio.d.ts +0 -176
- package/dist/studio.js +0 -55
- package/dist/utils-D_vtk3zK.cjs +0 -1
- package/dist/utils-VpVqnC9m.js +0 -1075
|
@@ -1,71 +1,80 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import { KeyboardIcon as R, PlusIcon as
|
|
3
|
-
import f, {
|
|
1
|
+
import { j as e } from "./jsx-runtime-Sp0orL4X.js";
|
|
2
|
+
import { KeyboardIcon as R, PlusIcon as _, Component2Icon as J } from "@radix-ui/react-icons";
|
|
3
|
+
import f, { useMemo as W, useState as p, useEffect as Y, memo as Z, lazy as v, Suspense as j } from "react";
|
|
4
4
|
import { useAtom as M } from "jotai";
|
|
5
|
-
import { filter as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { getChaiDataProviders as De, useChaiBlocks as Te } from "@chaibuilder/runtime";
|
|
5
|
+
import { filter as y, map as B, isNull as q, isEmpty as G, find as $, values as Q, each as X, get as ee } from "lodash-es";
|
|
6
|
+
import { D as O, n as H, o as F, p as U, q as se, a1 as re, a2 as ie, a3 as te, a4 as le, a5 as ae, a6 as oe, a7 as ne, a8 as ce, a9 as de, m as me, T as xe, d as pe, e as ue, B as x, S as K, E as he, F as fe, G as E, H as z } from "./context-menu-sks9vdzC.js";
|
|
7
|
+
import { u as je, b as ve, E as ge, J as be, a as Ne, d as ye, c as w, e as we } from "./index-Dgo2PNEV.js";
|
|
9
8
|
import { useTranslation as g } from "react-i18next";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import "./
|
|
15
|
-
import "
|
|
16
|
-
import "class-variance-authority";
|
|
17
|
-
import "./utils-VpVqnC9m.js";
|
|
18
|
-
import "clsx";
|
|
19
|
-
import "tailwind-merge";
|
|
9
|
+
import { ListTreeIcon as A, PaletteIcon as ke, DatabaseIcon as Ce } from "lucide-react";
|
|
10
|
+
import { getChaiDataProviders as De, useChaiBlocks as Te } from "@chaibuilder/runtime";
|
|
11
|
+
import { S as Se, c as Ae, b as Pe, d as _e, f as L } from "./select-JW3OMYm-.js";
|
|
12
|
+
import { O as o } from "./STRINGS--j49GZJP.js";
|
|
13
|
+
import { B as I } from "./badge-pJqQSA13.js";
|
|
14
|
+
import { c as Be } from "./iconBase-zweRWSz0.js";
|
|
20
15
|
import "@radix-ui/react-switch";
|
|
21
|
-
import "@radix-ui/react-slot";
|
|
22
16
|
import "@radix-ui/react-accordion";
|
|
17
|
+
import "class-variance-authority";
|
|
23
18
|
import "@radix-ui/react-alert-dialog";
|
|
24
|
-
import "@radix-ui/react-
|
|
19
|
+
import "@radix-ui/react-slot";
|
|
25
20
|
import "@radix-ui/react-label";
|
|
26
21
|
import "@radix-ui/react-scroll-area";
|
|
27
22
|
import "@radix-ui/react-tabs";
|
|
28
23
|
import "@radix-ui/react-tooltip";
|
|
29
24
|
import "@radix-ui/react-popover";
|
|
30
|
-
import "@radix-ui/react-menubar";
|
|
31
25
|
import "@radix-ui/react-hover-card";
|
|
32
|
-
import "@radix-ui/react-select";
|
|
33
26
|
import "@radix-ui/react-dropdown-menu";
|
|
34
|
-
import "@radix-ui/react-separator";
|
|
35
27
|
import "@radix-ui/react-toast";
|
|
36
28
|
import "cmdk";
|
|
29
|
+
import "@radix-ui/react-dialog";
|
|
37
30
|
import "@radix-ui/react-context-menu";
|
|
38
|
-
import "
|
|
39
|
-
import "
|
|
40
|
-
import "
|
|
31
|
+
import "clsx";
|
|
32
|
+
import "tailwind-merge";
|
|
33
|
+
import "./plugin-sJ3Hzvpv.js";
|
|
41
34
|
import "@react-hookz/web";
|
|
42
35
|
import "tree-model";
|
|
43
|
-
import "
|
|
44
|
-
import "react-
|
|
45
|
-
import "
|
|
36
|
+
import "react-quill";
|
|
37
|
+
import "react-hotkeys-hook";
|
|
38
|
+
import "@floating-ui/dom";
|
|
46
39
|
import "@floating-ui/react-dom";
|
|
47
40
|
import "flagged";
|
|
48
|
-
import "
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
import "@tailwindcss/typography";
|
|
42
|
+
import "@tailwindcss/forms";
|
|
43
|
+
import "@tailwindcss/aspect-ratio";
|
|
44
|
+
import "tailwindcss-palette-generator";
|
|
45
|
+
import "lodash";
|
|
46
|
+
import "react-wrap-balancer";
|
|
47
|
+
import "react-dom";
|
|
48
|
+
import "prop-types";
|
|
49
|
+
import "@rjsf/validator-ajv8";
|
|
50
|
+
import "@rjsf/core";
|
|
51
|
+
import "react-arborist";
|
|
52
|
+
import "himalaya";
|
|
53
|
+
import "react-icons-picker";
|
|
54
|
+
import "react-autosuggest";
|
|
55
|
+
import "fuse.js";
|
|
56
|
+
import "i18next";
|
|
57
|
+
import "@radix-ui/react-select";
|
|
58
|
+
const Ke = ({ provider: s, onClose: a }) => {
|
|
59
|
+
const { t } = g(), [l, u] = p(null);
|
|
60
|
+
return Y(() => {
|
|
61
|
+
s && (s.mockFn ? s.mockFn : s.dataFn)().then((c) => u(c));
|
|
53
62
|
}, [s]), s ? /* @__PURE__ */ e.jsx(O, { onOpenChange: (d) => d ? "" : a(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs(H, { children: [
|
|
54
|
-
/* @__PURE__ */ e.jsxs(
|
|
55
|
-
/* @__PURE__ */ e.jsxs(
|
|
56
|
-
|
|
63
|
+
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
64
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
65
|
+
t("data_provider"),
|
|
57
66
|
": ",
|
|
58
67
|
s.name
|
|
59
68
|
] }),
|
|
60
69
|
/* @__PURE__ */ e.jsx(se, { children: s.description })
|
|
61
70
|
] }),
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
|
|
71
|
+
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsx(
|
|
72
|
+
be,
|
|
64
73
|
{
|
|
65
|
-
data:
|
|
66
|
-
shouldExpandNode:
|
|
74
|
+
data: l,
|
|
75
|
+
shouldExpandNode: Ne,
|
|
67
76
|
style: {
|
|
68
|
-
...
|
|
77
|
+
...ye,
|
|
69
78
|
container: "max-h-[80vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",
|
|
70
79
|
stringValue: "text-orange-600",
|
|
71
80
|
label: "text-green-900 font-semibold pr-1 tracking-wider"
|
|
@@ -77,52 +86,52 @@ const Be = ({ provider: s, onClose: a }) => {
|
|
|
77
86
|
function Ee({
|
|
78
87
|
children: s,
|
|
79
88
|
name: a,
|
|
80
|
-
onRemove:
|
|
89
|
+
onRemove: t
|
|
81
90
|
}) {
|
|
82
|
-
const { t } = g();
|
|
91
|
+
const { t: l } = g();
|
|
83
92
|
return /* @__PURE__ */ e.jsxs(re, { children: [
|
|
84
93
|
/* @__PURE__ */ e.jsx(ie, { asChild: !0, children: s }),
|
|
85
|
-
/* @__PURE__ */ e.jsxs(
|
|
86
|
-
/* @__PURE__ */ e.jsxs(
|
|
94
|
+
/* @__PURE__ */ e.jsxs(te, { children: [
|
|
95
|
+
/* @__PURE__ */ e.jsxs(le, { children: [
|
|
87
96
|
/* @__PURE__ */ e.jsx(
|
|
88
97
|
ae,
|
|
89
98
|
{
|
|
90
|
-
dangerouslySetInnerHTML: { __html:
|
|
99
|
+
dangerouslySetInnerHTML: { __html: l("remove_provider_confirmation").replace("{name}", a) }
|
|
91
100
|
}
|
|
92
101
|
),
|
|
93
|
-
/* @__PURE__ */ e.jsx(oe, { children:
|
|
102
|
+
/* @__PURE__ */ e.jsx(oe, { children: l("remove_provider_warning") })
|
|
94
103
|
] }),
|
|
95
104
|
/* @__PURE__ */ e.jsxs(ne, { children: [
|
|
96
|
-
/* @__PURE__ */ e.jsx(ce, { children:
|
|
97
|
-
/* @__PURE__ */ e.jsx(de, { onClick:
|
|
105
|
+
/* @__PURE__ */ e.jsx(ce, { children: l("cancel") }),
|
|
106
|
+
/* @__PURE__ */ e.jsx(de, { onClick: t, className: "bg-red-600 hover:bg-red-700", children: l("remove") })
|
|
98
107
|
] })
|
|
99
108
|
] })
|
|
100
109
|
] });
|
|
101
110
|
}
|
|
102
111
|
const ze = () => {
|
|
103
|
-
const { t: s } = g(), a =
|
|
104
|
-
|
|
105
|
-
), [k,
|
|
106
|
-
a.map((r) =>
|
|
107
|
-
(r) => !
|
|
112
|
+
const { t: s } = g(), a = W(() => De(), []), [t, l] = je(), [, u] = M(ve), [d, c] = p(
|
|
113
|
+
y(a, (r) => B(t, "providerKey").includes(r.providerKey))
|
|
114
|
+
), [k, h] = p(""), [C, b] = p(null), D = y(
|
|
115
|
+
a.map((r) => B(d, "providerKey").includes(r.providerKey) ? null : { value: r.providerKey, label: r.name }),
|
|
116
|
+
(r) => !q(r)
|
|
108
117
|
), T = (r) => {
|
|
109
|
-
const m =
|
|
110
|
-
c((i) => [...i, m]),
|
|
111
|
-
},
|
|
112
|
-
c((m) =>
|
|
118
|
+
const m = $(a, { providerKey: r });
|
|
119
|
+
c((i) => [...i, m]), l((i) => [...i, { providerKey: m.providerKey, args: {} }]), h(""), u("UNSAVED");
|
|
120
|
+
}, N = (r) => {
|
|
121
|
+
c((m) => y(m, (i) => i.providerKey !== r.providerKey)), l((m) => y(m, (i) => i.providerKey !== r.providerKey)), u("UNSAVED");
|
|
113
122
|
}, n = (r) => b(r);
|
|
114
|
-
return
|
|
123
|
+
return G(a) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "mb-1.5 p-4 text-xs text-gray-500", children: [
|
|
115
124
|
s("no_data_providers"),
|
|
116
125
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
117
126
|
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: s("learn_more") })
|
|
118
127
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
119
128
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
120
129
|
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "mb-1.5 text-xs text-gray-500", children: s("add_data_providers") }) }),
|
|
121
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
122
|
-
/* @__PURE__ */ e.jsx(
|
|
123
|
-
/* @__PURE__ */ e.jsxs(
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
-
D.map((r) => /* @__PURE__ */ e.jsx(
|
|
130
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(Se, { value: k, onValueChange: (r) => T(r), children: [
|
|
131
|
+
/* @__PURE__ */ e.jsx(Ae, { className: "w-full", children: /* @__PURE__ */ e.jsx(Pe, { placeholder: s("select_provider") }) }),
|
|
132
|
+
/* @__PURE__ */ e.jsxs(_e, { children: [
|
|
133
|
+
/* @__PURE__ */ e.jsx(L, { value: "", children: s("choose") }),
|
|
134
|
+
D.map((r) => /* @__PURE__ */ e.jsx(L, { value: r.value, children: r.label }, r.value))
|
|
126
135
|
] })
|
|
127
136
|
] }) }),
|
|
128
137
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -171,7 +180,7 @@ const ze = () => {
|
|
|
171
180
|
]
|
|
172
181
|
}
|
|
173
182
|
),
|
|
174
|
-
/* @__PURE__ */ e.jsx(Ee, { onRemove: () =>
|
|
183
|
+
/* @__PURE__ */ e.jsx(Ee, { onRemove: () => N(r), name: r.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", children: [
|
|
175
184
|
/* @__PURE__ */ e.jsxs(
|
|
176
185
|
"svg",
|
|
177
186
|
{
|
|
@@ -199,54 +208,54 @@ const ze = () => {
|
|
|
199
208
|
},
|
|
200
209
|
r.providerKey
|
|
201
210
|
)) }),
|
|
202
|
-
/* @__PURE__ */ e.jsx(
|
|
211
|
+
/* @__PURE__ */ e.jsx(Ke, { onClose: () => b(null), provider: C })
|
|
203
212
|
] })
|
|
204
213
|
] });
|
|
205
|
-
}, Le =
|
|
214
|
+
}, Le = Z(() => {
|
|
206
215
|
const { t: s } = g(), a = {
|
|
207
216
|
"ctrl + Z": "Undo",
|
|
208
217
|
"ctrl + Y": "Redo",
|
|
209
218
|
"ctrl + D": "Duplicate"
|
|
210
|
-
},
|
|
219
|
+
}, t = {
|
|
211
220
|
// "ctrl + /": "Rename block",
|
|
212
221
|
"ctrl + S": "Save page",
|
|
213
222
|
esc: "Deselect blocks",
|
|
214
223
|
del: "Delete block"
|
|
215
224
|
};
|
|
216
225
|
return /* @__PURE__ */ e.jsxs(O, { children: [
|
|
217
|
-
/* @__PURE__ */ e.jsx(
|
|
218
|
-
/* @__PURE__ */ e.jsx(
|
|
219
|
-
/* @__PURE__ */ e.jsx(
|
|
226
|
+
/* @__PURE__ */ e.jsx(me, { children: /* @__PURE__ */ e.jsxs(xe, { children: [
|
|
227
|
+
/* @__PURE__ */ e.jsx(pe, { asChild: !0, children: /* @__PURE__ */ e.jsx("div", { className: "flex w-10 items-center justify-center", children: /* @__PURE__ */ e.jsx(R, {}) }) }),
|
|
228
|
+
/* @__PURE__ */ e.jsx(ue, { children: /* @__PURE__ */ e.jsx("p", { children: s("Keyboard shortcuts") }) })
|
|
220
229
|
] }) }),
|
|
221
230
|
/* @__PURE__ */ e.jsxs(H, { className: "sm:max-w-[525px]", children: [
|
|
222
|
-
/* @__PURE__ */ e.jsx(
|
|
231
|
+
/* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsx(U, { children: s("Keyboard shortcuts") }) }),
|
|
223
232
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2", children: [
|
|
224
|
-
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(a).map((
|
|
225
|
-
/* @__PURE__ */ e.jsx(
|
|
226
|
-
/* @__PURE__ */ e.jsx("div", { children: s(a[
|
|
227
|
-
] },
|
|
228
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(
|
|
229
|
-
/* @__PURE__ */ e.jsx(
|
|
230
|
-
/* @__PURE__ */ e.jsx("div", { children: s(l
|
|
231
|
-
] },
|
|
233
|
+
/* @__PURE__ */ e.jsx("div", { className: "mr-8 flex flex-col space-y-2 border-r border-gray-200", children: Object.keys(a).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
234
|
+
/* @__PURE__ */ e.jsx(I, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
|
|
235
|
+
/* @__PURE__ */ e.jsx("div", { children: s(a[l]) })
|
|
236
|
+
] }, l)) }),
|
|
237
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(t).map((l) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
238
|
+
/* @__PURE__ */ e.jsx(I, { variant: "outline", className: "border border-gray-600 p-1 px-2", children: s(l) }),
|
|
239
|
+
/* @__PURE__ */ e.jsx("div", { children: s(t[l]) })
|
|
240
|
+
] }, l)) })
|
|
232
241
|
] }) })
|
|
233
242
|
] })
|
|
234
243
|
] });
|
|
235
|
-
}), Ie =
|
|
244
|
+
}), Ie = v(() => import("./AddBlocks-Mm5byzEC.js")), P = v(() => import("./index-Dgo2PNEV.js").then((s) => s.ad)), Ve = v(() => import("./index-Dgo2PNEV.js").then((s) => s.ac)), Me = v(() => import("./index-Dgo2PNEV.js").then((s) => s.ae)), Oe = v(() => import("./UILibrariesPanel-a7TrMuAU.js")), He = () => /* @__PURE__ */ e.jsx("div", { className: "w-72", children: /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full animate-pulse rounded-md bg-gray-100" }), children: /* @__PURE__ */ e.jsx(Ie, {}) }) });
|
|
236
245
|
let V = null;
|
|
237
|
-
const
|
|
238
|
-
const s = w("sideBarComponents.top", []), a = w("sideBarComponents.bottom", []), [
|
|
246
|
+
const Js = () => {
|
|
247
|
+
const s = w("sideBarComponents.top", []), a = w("sideBarComponents.bottom", []), [t, l] = M(we), [u, d] = p(t), [c, k] = p(null), { t: h } = g(), C = w("uiLibraries", []), b = Te(), D = Q(b).find((i) => i.category === "custom") !== void 0, T = C.length > 0 || D, N = {
|
|
239
248
|
"add-blocks": He,
|
|
240
249
|
[o]: P,
|
|
241
250
|
"theme-configuration": Ve,
|
|
242
251
|
images: Me,
|
|
243
252
|
"ui-libraries": Oe
|
|
244
253
|
};
|
|
245
|
-
|
|
246
|
-
|
|
254
|
+
X(s, ({ name: i, panel: S }) => {
|
|
255
|
+
N[i] = S;
|
|
247
256
|
});
|
|
248
257
|
const n = (i) => {
|
|
249
|
-
clearTimeout(V),
|
|
258
|
+
clearTimeout(V), t !== o && i === o ? V = setTimeout(() => l(o), 500) : d(i), l(i);
|
|
250
259
|
}, r = w("dataBindingSupport", !1);
|
|
251
260
|
function m() {
|
|
252
261
|
const i = setTimeout(() => {
|
|
@@ -255,7 +264,7 @@ const Ls = () => {
|
|
|
255
264
|
k(i);
|
|
256
265
|
}
|
|
257
266
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex", children: [
|
|
258
|
-
|
|
267
|
+
t !== o ? /* @__PURE__ */ e.jsx(
|
|
259
268
|
"div",
|
|
260
269
|
{
|
|
261
270
|
onMouseEnter: m,
|
|
@@ -271,8 +280,8 @@ const Ls = () => {
|
|
|
271
280
|
{
|
|
272
281
|
onClick: () => n("add-blocks"),
|
|
273
282
|
size: "sm",
|
|
274
|
-
variant:
|
|
275
|
-
children: /* @__PURE__ */ e.jsx(
|
|
283
|
+
variant: t === "add-blocks" ? "default" : "outline",
|
|
284
|
+
children: /* @__PURE__ */ e.jsx(_, { className: "text-xl" })
|
|
276
285
|
}
|
|
277
286
|
),
|
|
278
287
|
/* @__PURE__ */ e.jsx(
|
|
@@ -280,7 +289,7 @@ const Ls = () => {
|
|
|
280
289
|
{
|
|
281
290
|
onClick: () => n("ui-libraries"),
|
|
282
291
|
size: "sm",
|
|
283
|
-
variant:
|
|
292
|
+
variant: t === "ui-libraries" ? "default" : "outline",
|
|
284
293
|
children: /* @__PURE__ */ e.jsx(J, { className: "text-xl" })
|
|
285
294
|
}
|
|
286
295
|
)
|
|
@@ -289,8 +298,8 @@ const Ls = () => {
|
|
|
289
298
|
{
|
|
290
299
|
onClick: () => n("add-blocks"),
|
|
291
300
|
size: "sm",
|
|
292
|
-
variant:
|
|
293
|
-
children: /* @__PURE__ */ e.jsx(
|
|
301
|
+
variant: t === "add-blocks" ? "default" : "outline",
|
|
302
|
+
children: /* @__PURE__ */ e.jsx(_, { className: "text-xl" })
|
|
294
303
|
}
|
|
295
304
|
),
|
|
296
305
|
/* @__PURE__ */ e.jsx(
|
|
@@ -298,8 +307,8 @@ const Ls = () => {
|
|
|
298
307
|
{
|
|
299
308
|
onClick: () => n(o),
|
|
300
309
|
size: "sm",
|
|
301
|
-
variant:
|
|
302
|
-
children: /* @__PURE__ */ e.jsx(
|
|
310
|
+
variant: t === o ? "default" : "outline",
|
|
311
|
+
children: /* @__PURE__ */ e.jsx(A, { className: "w-4" })
|
|
303
312
|
}
|
|
304
313
|
),
|
|
305
314
|
/* @__PURE__ */ e.jsx(
|
|
@@ -307,19 +316,19 @@ const Ls = () => {
|
|
|
307
316
|
{
|
|
308
317
|
onClick: () => n("theme-configuration"),
|
|
309
318
|
size: "sm",
|
|
310
|
-
variant:
|
|
319
|
+
variant: t === "theme-configuration" ? "default" : "outline",
|
|
311
320
|
children: /* @__PURE__ */ e.jsx(ke, { className: "w-4 max-w-[40px] text-xs" })
|
|
312
321
|
}
|
|
313
322
|
),
|
|
314
323
|
f.Children.toArray(
|
|
315
|
-
s.map(({ name: i, icon:
|
|
324
|
+
s.map(({ name: i, icon: S }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(K, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
316
325
|
x,
|
|
317
326
|
{
|
|
318
327
|
onClick: () => n(i),
|
|
319
328
|
size: "sm",
|
|
320
329
|
className: "w-10",
|
|
321
|
-
variant:
|
|
322
|
-
children: /* @__PURE__ */ e.jsx(
|
|
330
|
+
variant: t === i ? "default" : "outline",
|
|
331
|
+
children: /* @__PURE__ */ e.jsx(S, {})
|
|
323
332
|
}
|
|
324
333
|
) }))
|
|
325
334
|
)
|
|
@@ -327,16 +336,16 @@ const Ls = () => {
|
|
|
327
336
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2", children: [
|
|
328
337
|
/* @__PURE__ */ e.jsx(Le, {}),
|
|
329
338
|
f.Children.toArray(
|
|
330
|
-
a.map((i) => /* @__PURE__ */ e.jsx(
|
|
339
|
+
a.map((i) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(K, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(i, {}) }))
|
|
331
340
|
)
|
|
332
341
|
] })
|
|
333
342
|
] }),
|
|
334
|
-
|
|
343
|
+
t !== o ? /* @__PURE__ */ e.jsx(
|
|
335
344
|
"div",
|
|
336
345
|
{
|
|
337
346
|
className: "absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",
|
|
338
347
|
children: /* @__PURE__ */ e.jsx(
|
|
339
|
-
|
|
348
|
+
j,
|
|
340
349
|
{
|
|
341
350
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
|
|
342
351
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -346,13 +355,13 @@ const Ls = () => {
|
|
|
346
355
|
children: /* @__PURE__ */ e.jsx(
|
|
347
356
|
"div",
|
|
348
357
|
{
|
|
349
|
-
className:
|
|
358
|
+
className: Be(
|
|
350
359
|
"relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"
|
|
351
360
|
),
|
|
352
361
|
onMouseEnter: () => {
|
|
353
362
|
c && clearTimeout(c);
|
|
354
363
|
},
|
|
355
|
-
children: f.createElement(ee(
|
|
364
|
+
children: f.createElement(ee(N, t, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
356
365
|
}
|
|
357
366
|
)
|
|
358
367
|
}
|
|
@@ -360,32 +369,32 @@ const Ls = () => {
|
|
|
360
369
|
}
|
|
361
370
|
) : null,
|
|
362
371
|
/* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
|
|
363
|
-
|
|
372
|
+
j,
|
|
364
373
|
{
|
|
365
374
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
|
|
366
375
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
367
376
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
368
377
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
369
378
|
] }),
|
|
370
|
-
children: r ? /* @__PURE__ */ e.jsxs(
|
|
371
|
-
/* @__PURE__ */ e.jsxs(
|
|
372
|
-
/* @__PURE__ */ e.jsxs(
|
|
373
|
-
/* @__PURE__ */ e.jsx(
|
|
379
|
+
children: r ? /* @__PURE__ */ e.jsxs(he, { defaultValue: o, className: "flex h-full w-full flex-col py-1", children: [
|
|
380
|
+
/* @__PURE__ */ e.jsxs(fe, { className: "mx-1 grid h-10 grid-cols-2", children: [
|
|
381
|
+
/* @__PURE__ */ e.jsxs(E, { value: o, children: [
|
|
382
|
+
/* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
|
|
374
383
|
" ",
|
|
375
|
-
|
|
384
|
+
h("Outline")
|
|
376
385
|
] }),
|
|
377
|
-
/* @__PURE__ */ e.jsxs(
|
|
386
|
+
/* @__PURE__ */ e.jsxs(E, { value: "data-provider", children: [
|
|
378
387
|
/* @__PURE__ */ e.jsx(Ce, { className: "mr-2 w-3" }),
|
|
379
|
-
|
|
388
|
+
h("Data")
|
|
380
389
|
] })
|
|
381
390
|
] }),
|
|
382
|
-
/* @__PURE__ */ e.jsx(
|
|
383
|
-
/* @__PURE__ */ e.jsx(
|
|
391
|
+
/* @__PURE__ */ e.jsx(z, { value: o, className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: f.createElement(P) }),
|
|
392
|
+
/* @__PURE__ */ e.jsx(z, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(ze, {}) })
|
|
384
393
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
385
394
|
/* @__PURE__ */ e.jsxs("div", { className: "sticky top-0 -m-1 flex h-fit items-center justify-center border-b bg-gray-100 py-2 pb-[9px] text-sm", children: [
|
|
386
|
-
/* @__PURE__ */ e.jsx(
|
|
395
|
+
/* @__PURE__ */ e.jsx(A, { className: "mr-2 h-3" }),
|
|
387
396
|
" ",
|
|
388
|
-
|
|
397
|
+
h("Outline")
|
|
389
398
|
] }),
|
|
390
399
|
/* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2", children: f.createElement(P) })
|
|
391
400
|
] })
|
|
@@ -394,5 +403,5 @@ const Ls = () => {
|
|
|
394
403
|
] });
|
|
395
404
|
};
|
|
396
405
|
export {
|
|
397
|
-
|
|
406
|
+
Js as default
|
|
398
407
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-JYMCiFoE.cjs"),N=require("@radix-ui/react-icons"),i=require("react"),P=require("jotai"),u=require("lodash-es"),s=require("./context-menu-_8TFbFEJ.cjs"),c=require("./index-jhNzBWrV.cjs"),g=require("react-i18next"),f=require("lucide-react"),_=require("@chaibuilder/runtime"),h=require("./select-fXj5tdMX.cjs"),a=require("./STRINGS-gPz7CUOk.cjs"),S=require("./badge-7BVT3zxN.cjs"),I=require("./iconBase-vJD0OXxU.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("class-variance-authority");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");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-hover-card");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-dialog");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");require("./plugin-_F-KZp1i.cjs");require("@react-hookz/web");require("tree-model");require("react-quill");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("lodash");require("react-wrap-balancer");require("react-dom");require("prop-types");require("@rjsf/validator-ajv8");require("@rjsf/core");require("react-arborist");require("himalaya");require("react-icons-picker");require("react-autosuggest");require("fuse.js");require("i18next");require("@radix-ui/react-select");const K=({provider:t,onClose:x})=>{const{t:o}=g.useTranslation(),[l,E]=i.useState(null);return i.useEffect(()=>{t&&(t.mockFn?t.mockFn:t.dataFn)().then(m=>E(m))},[t]),t?e.jsxRuntimeExports.jsx(s.Dialog,{onOpenChange:j=>j?"":x(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(s.DialogContent,{children:[e.jsxRuntimeExports.jsxs(s.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(s.DialogTitle,{children:[o("data_provider"),": ",t.name]}),e.jsxRuntimeExports.jsx(s.DialogDescription,{children:t.description})]}),e.jsxRuntimeExports.jsx(c.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(c.JsonView,{data:l,shouldExpandNode:c.allExpanded,style:{...c.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 L({children:t,name:x,onRemove:o}){const{t:l}=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:l("remove_provider_confirmation").replace("{name}",x)}}),e.jsxRuntimeExports.jsx(s.AlertDialogDescription,{children:l("remove_provider_warning")})]}),e.jsxRuntimeExports.jsxs(s.AlertDialogFooter,{children:[e.jsxRuntimeExports.jsx(s.AlertDialogCancel,{children:l("cancel")}),e.jsxRuntimeExports.jsx(s.AlertDialogAction,{onClick:o,className:"bg-red-600 hover:bg-red-700",children:l("remove")})]})]})]})}const B=()=>{const{t}=g.useTranslation(),x=i.useMemo(()=>_.getChaiDataProviders(),[]),[o,l]=c.usePageDataProviders(),[,E]=P.useAtom(c.builderSaveStateAtom),[j,m]=i.useState(u.filter(x,r=>u.map(o,"providerKey").includes(r.providerKey))),[y,v]=i.useState(""),[q,R]=i.useState(null),w=u.filter(x.map(r=>u.map(j,"providerKey").includes(r.providerKey)?null:{value:r.providerKey,label:r.name}),r=>!u.isNull(r)),T=r=>{const p=u.find(x,{providerKey:r});m(n=>[...n,p]),l(n=>[...n,{providerKey:p.providerKey,args:{}}]),v(""),E("UNSAVED")},b=r=>{m(p=>u.filter(p,n=>n.providerKey!==r.providerKey)),l(p=>u.filter(p,n=>n.providerKey!==r.providerKey)),E("UNSAVED")},d=r=>R(r);return u.isEmpty(x)?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 p-4 text-xs text-gray-500",children:[t("no_data_providers"),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:t("learn_more")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"mb-1.5 text-xs text-gray-500",children:t("add_data_providers")})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-1",children:e.jsxRuntimeExports.jsxs(h.Select,{value:y,onValueChange:r=>T(r),children:[e.jsxRuntimeExports.jsx(h.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(h.SelectValue,{placeholder:t("select_provider")})}),e.jsxRuntimeExports.jsxs(h.SelectContent,{children:[e.jsxRuntimeExports.jsx(h.SelectItem,{value:"",children:t("choose")}),w.map(r=>e.jsxRuntimeExports.jsx(h.SelectItem,{value:r.value,children:r.label},r.value))]})]})}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:`border-t ${j.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:j.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:()=>d(r),className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-blue-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),t("view_data")]}),e.jsxRuntimeExports.jsx(L,{onRemove:()=>b(r),name:r.name,children:e.jsxRuntimeExports.jsxs("button",{className:"inline-flex h-9 items-center justify-center rounded-md px-3 text-xs font-medium text-red-500 underline-offset-4 ring-offset-background transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:[e.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:[e.jsxRuntimeExports.jsx("path",{d:"M3 6h18"}),e.jsxRuntimeExports.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e.jsxRuntimeExports.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]}),t("remove")]})})]})]},r.providerKey))}),e.jsxRuntimeExports.jsx(K,{onClose:()=>R(null),provider:q})]})]})},A=i.memo(()=>{const{t}=g.useTranslation(),x={"ctrl + Z":"Undo","ctrl + Y":"Redo","ctrl + D":"Duplicate"},o={"ctrl + S":"Save page",esc:"Deselect blocks",del:"Delete block"};return e.jsxRuntimeExports.jsxs(s.Dialog,{children:[e.jsxRuntimeExports.jsx(s.DialogTrigger,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("div",{className:"flex w-10 items-center justify-center",children:e.jsxRuntimeExports.jsx(N.KeyboardIcon,{})})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t("Keyboard shortcuts")})})]})}),e.jsxRuntimeExports.jsxs(s.DialogContent,{className:"sm:max-w-[525px]",children:[e.jsxRuntimeExports.jsx(s.DialogHeader,{children:e.jsxRuntimeExports.jsx(s.DialogTitle,{children:t("Keyboard shortcuts")})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2",children:[e.jsxRuntimeExports.jsx("div",{className:"mr-8 flex flex-col space-y-2 border-r border-gray-200",children:Object.keys(x).map(l=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(S.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(l)}),e.jsxRuntimeExports.jsx("div",{children:t(x[l])})]},l))}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-y-2",children:Object.keys(o).map(l=>e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx(S.Badge,{variant:"outline",className:"border border-gray-600 p-1 px-2",children:t(l)}),e.jsxRuntimeExports.jsx("div",{children:t(o[l])})]},l))})]})})]})]})}),O=i.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-jaxiAG4L.cjs"))),C=i.lazy(()=>Promise.resolve().then(()=>require("./index-jhNzBWrV.cjs")).then(t=>t.ListTree$1)),U=i.lazy(()=>Promise.resolve().then(()=>require("./index-jhNzBWrV.cjs")).then(t=>t.ThemeConfigPanel$1)),z=i.lazy(()=>Promise.resolve().then(()=>require("./index-jhNzBWrV.cjs")).then(t=>t.ImagesPanel)),Y=i.lazy(()=>Promise.resolve().then(()=>require("./UILibrariesPanel-ADjJse3_.cjs"))),V=()=>e.jsxRuntimeExports.jsx("div",{className:"w-72",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full animate-pulse rounded-md bg-gray-100"}),children:e.jsxRuntimeExports.jsx(O,{})})});let D=null;const M=()=>{const t=c.useBuilderProp("sideBarComponents.top",[]),x=c.useBuilderProp("sideBarComponents.bottom",[]),[o,l]=P.useAtom(c.activePanelAtom),[E,j]=i.useState(o),[m,y]=i.useState(null),{t:v}=g.useTranslation(),q=c.useBuilderProp("uiLibraries",[]),R=_.useChaiBlocks(),w=u.values(R).find(n=>n.category==="custom")!==void 0,T=q.length>0||w,b={"add-blocks":V,[a.OUTLINE_KEY]:C,"theme-configuration":U,images:z,"ui-libraries":Y};u.each(t,({name:n,panel:k})=>{b[n]=k});const d=n=>{clearTimeout(D),o!==a.OUTLINE_KEY&&n===a.OUTLINE_KEY?D=setTimeout(()=>l(a.OUTLINE_KEY),500):j(n),l(n)},r=c.useBuilderProp("dataBindingSupport",!1);function p(){const n=setTimeout(()=>{m&&(d(a.OUTLINE_KEY),clearTimeout(m))},500);y(n)}return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[o!==a.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{onMouseEnter:p,onClick:()=>d(a.OUTLINE_KEY),className:"fixed inset-0 z-[50] bg-black/20"}):null,e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[T?e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 rounded-md bg-gray-200 p-1",children:[e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("add-blocks"),size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("ui-libraries"),size:"sm",variant:o==="ui-libraries"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.Component2Icon,{className:"text-xl"})})]}):e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("add-blocks"),size:"sm",variant:o==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(a.OUTLINE_KEY),size:"sm",variant:o===a.OUTLINE_KEY?"default":"outline",children:e.jsxRuntimeExports.jsx(f.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d("theme-configuration"),size:"sm",variant:o==="theme-configuration"?"default":"outline",children:e.jsxRuntimeExports.jsx(f.PaletteIcon,{className:"w-4 max-w-[40px] text-xs"})}),i.Children.toArray(t.map(({name:n,icon:k})=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(s.Button,{onClick:()=>d(n),size:"sm",className:"w-10",variant:o===n?"default":"outline",children:e.jsxRuntimeExports.jsx(k,{})})})))]}),e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2 pb-2",children:[e.jsxRuntimeExports.jsx(A,{}),i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]}),o!==a.OUTLINE_KEY?e.jsxRuntimeExports.jsx("div",{className:"absolute left-14 z-[50] h-[100vh] w-fit translate-x-0 border-r bg-background transition-all duration-500 ease-in-out",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:I.cn("relative z-[100] h-full max-h-full overflow-y-auto overflow-x-hidden border-r bg-background p-1 shadow-md"),onMouseEnter:()=>{m&&clearTimeout(m)},children:i.createElement(u.get(b,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}):null,e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:r?e.jsxRuntimeExports.jsxs(s.Tabs,{defaultValue:a.OUTLINE_KEY,className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(s.TabsList,{className:"mx-1 grid h-10 grid-cols-2",children:[e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:a.OUTLINE_KEY,children:[e.jsxRuntimeExports.jsx(f.ListTreeIcon,{className:"mr-2 h-3"})," ",v("Outline")]}),e.jsxRuntimeExports.jsxs(s.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(f.DatabaseIcon,{className:"mr-2 w-3"}),v("Data")]})]}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:a.OUTLINE_KEY,className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:i.createElement(C)}),e.jsxRuntimeExports.jsx(s.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(B,{})})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"sticky top-0 -m-1 flex h-fit items-center justify-center border-b bg-gray-100 py-2 pb-[9px] text-sm",children:[e.jsxRuntimeExports.jsx(f.ListTreeIcon,{className:"mr-2 h-3"})," ",v("Outline")]}),e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden pt-2",children:i.createElement(C)})]})})})]})};exports.default=M;
|