@chaibuilder/sdk 1.1.14 → 1.1.16
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-1DrS62uN.js +222 -0
- package/dist/AddBlocks-jqRRefXj.cjs +1 -0
- package/dist/BrandingOptions-TRVyCvVq.cjs +1 -0
- package/dist/{BrandingOptions-4qzTYdj5.js → BrandingOptions-zFJ28xmJ.js} +18 -19
- package/dist/CanvasArea-5oxRxEDL.cjs +59 -0
- package/dist/CanvasArea-j8iIkWN-.js +1438 -0
- package/dist/{CurrentPage-zxrdTVsG.cjs → CurrentPage-CsENtl7b.cjs} +1 -1
- package/dist/{CurrentPage-spjJpQSM.js → CurrentPage-cNRrM2vd.js} +1 -1
- package/dist/{Layers-QNAlCI4j.js → Layers-6Fa_6Vy2.js} +2 -2
- package/dist/{Layers-YyBChBtg.cjs → Layers-r6pP4nDP.cjs} +1 -1
- package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-xOHhiMDl.js → MarkAsGlobalBlock-uhj0kGZo.js} +23 -23
- package/dist/{PagesPanel-BeJrveus.cjs → PagesPanel-UXqoXG-j.cjs} +1 -1
- package/dist/{PagesPanel--LI-BoSj.js → PagesPanel-s2qoPZc-.js} +2 -2
- package/dist/{ProjectPanel-VNj0jXca.js → ProjectPanel-9z6zVYBb.js} +2 -2
- package/dist/{ProjectPanel-MjcAymKT.cjs → ProjectPanel-izG3GYtn.cjs} +1 -1
- package/dist/Settings-iLeODb_n.js +2188 -0
- package/dist/Settings-olFxwKg4.cjs +1 -0
- package/dist/SidePanels-1QED7mo6.cjs +1 -0
- package/dist/{SidePanels-4lvmnnlw.js → SidePanels-CWAz1HdY.js} +125 -124
- package/dist/add-page-modal-rn0OScnT.cjs +1 -0
- package/dist/{add-page-modal-fZnKopNf.js → add-page-modal-vT0-45wi.js} +6 -7
- package/dist/controls-QnyBNkXG.cjs +36 -0
- package/dist/controls-kEuiMMDf.js +4600 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-P_KKu12n.cjs → delete-page-modal-EZ4gIG3s.cjs} +1 -1
- package/dist/{delete-page-modal-fRoXPfhG.js → delete-page-modal-hWmFarnh.js} +1 -1
- package/dist/index-Ge20J9Pa.cjs +206 -0
- package/dist/{index-CQz6j3ex.js → index-TWBwhGkh.js} +4957 -4262
- package/dist/mockServiceWorker.js +10 -18
- package/dist/{page-viewer-39ZtxLzx.js → page-viewer-TZC26UCW.js} +2 -2
- package/dist/{page-viewer-_lc8vqU4.cjs → page-viewer-yH4HdYhv.cjs} +1 -1
- package/dist/{project-general-setting-CCVuGyHh.js → project-general-setting-SjVbcwgp.js} +7 -8
- package/dist/project-general-setting-eEQDxjVm.cjs +1 -0
- package/dist/{project-seo-setting-Wo7E46w7.js → project-seo-setting-EhqUcTKy.js} +7 -8
- package/dist/project-seo-setting-N0OnBCvh.cjs +1 -0
- package/dist/single-page-detail-76T7ZZzC.cjs +1 -0
- package/dist/{single-page-detail-r1GJF00l.js → single-page-detail-ePzFhs8m.js} +47 -48
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +3 -2
- package/dist/AddBlocks-AG_J7s2Z.cjs +0 -1
- package/dist/AddBlocks-FsdsASNp.js +0 -222
- package/dist/BrandingOptions-xBuqDpj0.cjs +0 -1
- package/dist/CanvasArea-4m1-c1yq.cjs +0 -59
- package/dist/CanvasArea-U3egqewu.js +0 -1434
- package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +0 -1
- package/dist/Settings-BrYkhn3H.cjs +0 -1
- package/dist/Settings-LZJwbkO6.js +0 -2189
- package/dist/SidePanels-_5oUp-eI.cjs +0 -1
- package/dist/add-page-modal-rWhPuGd9.cjs +0 -1
- package/dist/controls-G0puEH71.js +0 -120
- package/dist/controls-aHZq-q4b.cjs +0 -1
- package/dist/index-1Dr-VtaT.cjs +0 -206
- package/dist/project-general-setting-LEzDhwoq.cjs +0 -1
- package/dist/project-seo-setting-orwH-Ufg.cjs +0 -1
- package/dist/single-page-detail-jkDYF7lW.cjs +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-NV737rRe.js";
|
|
2
|
-
import { PlusIcon as
|
|
3
|
-
import p, { useState as u, useEffect as
|
|
4
|
-
import { useAtom as
|
|
5
|
-
import { b as
|
|
6
|
-
import { ak as
|
|
7
|
-
import { ListTreeIcon as
|
|
8
|
-
import { getChaiDataProviders as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { PlusIcon as V, Half2Icon as M } from "@radix-ui/react-icons";
|
|
3
|
+
import p, { useState as u, useEffect as H, useMemo as I, lazy as y, Suspense as j } from "react";
|
|
4
|
+
import { useAtom as P } from "jotai";
|
|
5
|
+
import { b as g, d as T, A as L, j as F, a as O, f as R, g as J } from "./lodash-3gkdNK5u.js";
|
|
6
|
+
import { ak as U, al as $, am as q, an as G, ao as Y, D as Z, E as Q, F as W, G as X, H as ee, I as se, J as re, K as ae, ap as le, s as ie, t as te, aq as oe, ar as ne, as as ce, at as de, au as _, i as C, av as me, aw as xe, B as b, S as z, ax as pe, ay as ue, az as K, aA as B } from "./index-0OqmBgqo.js";
|
|
7
|
+
import { ListTreeIcon as D, DatabaseIcon as he } from "lucide-react";
|
|
8
|
+
import { getChaiDataProviders as fe } from "@chaibuilder/runtime";
|
|
9
|
+
import { useTranslation as S } from "react-i18next";
|
|
10
|
+
import { E as ve } from "./index-TWBwhGkh.js";
|
|
11
|
+
import { d as je } from "./utils-XsPKXMVo.js";
|
|
11
12
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
12
13
|
import "@radix-ui/react-toggle";
|
|
13
14
|
import "class-variance-authority";
|
|
@@ -35,7 +36,6 @@ import "react-quill";
|
|
|
35
36
|
import "flat-to-nested";
|
|
36
37
|
import "redux-undo";
|
|
37
38
|
import "@react-hookz/web";
|
|
38
|
-
import "react-i18next";
|
|
39
39
|
import "i18next";
|
|
40
40
|
import "clsx";
|
|
41
41
|
import "@floating-ui/react-dom";
|
|
@@ -48,84 +48,85 @@ import "sonner";
|
|
|
48
48
|
import "./html-to-json-Y5M0N8PH.js";
|
|
49
49
|
import "himalaya";
|
|
50
50
|
import "tailwind-merge";
|
|
51
|
-
const
|
|
52
|
-
const [
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
/* @__PURE__ */ e.jsxs(
|
|
57
|
-
/* @__PURE__ */ e.jsxs(
|
|
58
|
-
"
|
|
59
|
-
|
|
51
|
+
const ge = p.lazy(() => import("react-json-view")), be = ({ provider: r, onClose: t }) => {
|
|
52
|
+
const { t: a } = S(), [i, m] = u(null);
|
|
53
|
+
return H(() => {
|
|
54
|
+
r && (r.mockFn ? r.mockFn : r.dataFn)().then((n) => m(n));
|
|
55
|
+
}, [r]), r ? /* @__PURE__ */ e.jsx(U, { onOpenChange: (o) => o ? "" : t(), defaultOpen: !0, children: /* @__PURE__ */ e.jsxs($, { children: [
|
|
56
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
57
|
+
/* @__PURE__ */ e.jsxs(G, { children: [
|
|
58
|
+
a("data_provider"),
|
|
59
|
+
": ",
|
|
60
|
+
r.name
|
|
60
61
|
] }),
|
|
61
|
-
/* @__PURE__ */ e.jsx(
|
|
62
|
+
/* @__PURE__ */ e.jsx(Y, { children: r.description })
|
|
62
63
|
] }),
|
|
63
|
-
/* @__PURE__ */ e.jsx(
|
|
64
|
-
|
|
64
|
+
/* @__PURE__ */ e.jsx(ve, { children: /* @__PURE__ */ e.jsx(
|
|
65
|
+
ge,
|
|
65
66
|
{
|
|
66
67
|
style: { maxHeight: "80vh", overflowY: "auto" },
|
|
67
|
-
name:
|
|
68
|
+
name: r.providerKey,
|
|
68
69
|
enableClipboard: !1,
|
|
69
70
|
displayObjectSize: !1,
|
|
70
71
|
displayDataTypes: !1,
|
|
71
|
-
src:
|
|
72
|
+
src: i
|
|
72
73
|
}
|
|
73
74
|
) })
|
|
74
75
|
] }) }) : null;
|
|
75
76
|
};
|
|
76
|
-
function
|
|
77
|
-
children:
|
|
78
|
-
name:
|
|
79
|
-
onRemove:
|
|
77
|
+
function ye({
|
|
78
|
+
children: r,
|
|
79
|
+
name: t,
|
|
80
|
+
onRemove: a
|
|
80
81
|
}) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */ e.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
" provider?"
|
|
89
|
-
] }),
|
|
90
|
-
/* @__PURE__ */ e.jsx(X, { children: "Your data provider will be removed from this page and all added data binding will be not visible on blocks." })
|
|
82
|
+
const { t: i } = S();
|
|
83
|
+
return /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
84
|
+
/* @__PURE__ */ e.jsx(Q, { asChild: !0, children: r }),
|
|
85
|
+
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
86
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
87
|
+
/* @__PURE__ */ e.jsx(ee, { children: i("remove_provider_confirmation", { name: t }) }),
|
|
88
|
+
/* @__PURE__ */ e.jsx(se, { children: i("remove_provider_warning") })
|
|
91
89
|
] }),
|
|
92
|
-
/* @__PURE__ */ e.jsxs(
|
|
93
|
-
/* @__PURE__ */ e.jsx(
|
|
94
|
-
/* @__PURE__ */ e.jsx(
|
|
90
|
+
/* @__PURE__ */ e.jsxs(re, { children: [
|
|
91
|
+
/* @__PURE__ */ e.jsx(ae, { children: i("cancel") }),
|
|
92
|
+
/* @__PURE__ */ e.jsx(le, { onClick: a, className: "bg-red-600 hover:bg-red-700", children: i("remove") })
|
|
95
93
|
] })
|
|
96
94
|
] })
|
|
97
95
|
] });
|
|
98
96
|
}
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
), [
|
|
103
|
-
|
|
104
|
-
(s) => !
|
|
105
|
-
),
|
|
106
|
-
const x =
|
|
107
|
-
n((
|
|
108
|
-
},
|
|
109
|
-
n((x) =>
|
|
110
|
-
},
|
|
111
|
-
return
|
|
112
|
-
"
|
|
97
|
+
const Ne = () => {
|
|
98
|
+
const { t: r } = S(), t = I(() => fe(), []), [a, i] = ie(), [, m] = P(te), [o, n] = u(
|
|
99
|
+
g(t, (s) => T(a, "providerKey").includes(s.providerKey))
|
|
100
|
+
), [N, f] = u(""), [c, v] = u(null), w = g(
|
|
101
|
+
t.map((s) => T(o, "providerKey").includes(s.providerKey) ? null : { value: s.providerKey, label: s.name }),
|
|
102
|
+
(s) => !L(s)
|
|
103
|
+
), k = (s) => {
|
|
104
|
+
const x = F(t, { providerKey: s });
|
|
105
|
+
n((d) => [...d, x]), i((d) => [...d, { providerKey: x.providerKey, args: {} }]), f(""), m("UNSAVED");
|
|
106
|
+
}, l = (s) => {
|
|
107
|
+
n((x) => g(x, (d) => d.providerKey !== s.providerKey)), i((x) => g(x, (d) => d.providerKey !== s.providerKey)), m("UNSAVED");
|
|
108
|
+
}, h = (s) => v(s);
|
|
109
|
+
return O(t) ? /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 mb-1.5 text-xs p-4", children: [
|
|
110
|
+
r("no_data_providers"),
|
|
113
111
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
114
|
-
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: "
|
|
112
|
+
/* @__PURE__ */ e.jsx("a", { className: "text-blue-500", href: "https://chaibuilder.com/docs/registering-data-providers", target: "_blank", children: r("learn_more") })
|
|
115
113
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-1", children: [
|
|
116
114
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
117
|
-
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: "
|
|
118
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(
|
|
119
|
-
/* @__PURE__ */ e.jsx(
|
|
120
|
-
/* @__PURE__ */ e.jsxs(
|
|
121
|
-
/* @__PURE__ */ e.jsx(
|
|
122
|
-
|
|
115
|
+
/* @__PURE__ */ e.jsx("label", { children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-500 mb-1.5 text-xs", children: r("add_data_providers") }) }),
|
|
116
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-1", children: /* @__PURE__ */ e.jsxs(oe, { value: N, onValueChange: (s) => k(s), children: [
|
|
117
|
+
/* @__PURE__ */ e.jsx(ne, { className: "w-full", children: /* @__PURE__ */ e.jsx(ce, { placeholder: r("select_provider") }) }),
|
|
118
|
+
/* @__PURE__ */ e.jsxs(de, { children: [
|
|
119
|
+
/* @__PURE__ */ e.jsx(_, { value: "", children: r("choose") }),
|
|
120
|
+
w.map((s) => /* @__PURE__ */ e.jsx(_, { value: s.value, children: s.label }, s.value))
|
|
123
121
|
] })
|
|
124
122
|
] }) }),
|
|
125
123
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
126
|
-
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${
|
|
127
|
-
/* @__PURE__ */ e.
|
|
128
|
-
|
|
124
|
+
/* @__PURE__ */ e.jsxs("div", { className: `border-t ${o.length ? "block" : "hidden"}`, children: [
|
|
125
|
+
/* @__PURE__ */ e.jsxs("p", { className: "text-gray-500 pt-4 pb-1.5 text-xs flex-1 font-medium", children: [
|
|
126
|
+
r("page_data_providers"),
|
|
127
|
+
":"
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: o.map((s) => /* @__PURE__ */ e.jsxs(
|
|
129
130
|
"div",
|
|
130
131
|
{
|
|
131
132
|
className: "rounded-lg border bg-card text-card-foreground shadow-sm w-full",
|
|
@@ -139,7 +140,7 @@ const be = () => {
|
|
|
139
140
|
/* @__PURE__ */ e.jsxs(
|
|
140
141
|
"button",
|
|
141
142
|
{
|
|
142
|
-
onClick: () =>
|
|
143
|
+
onClick: () => h(s),
|
|
143
144
|
className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-blue-500",
|
|
144
145
|
children: [
|
|
145
146
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -161,11 +162,11 @@ const be = () => {
|
|
|
161
162
|
]
|
|
162
163
|
}
|
|
163
164
|
),
|
|
164
|
-
"
|
|
165
|
+
r("view_data")
|
|
165
166
|
]
|
|
166
167
|
}
|
|
167
168
|
),
|
|
168
|
-
/* @__PURE__ */ e.jsx(
|
|
169
|
+
/* @__PURE__ */ e.jsx(ye, { onRemove: () => l(s), name: s.name, children: /* @__PURE__ */ e.jsxs("button", { className: "inline-flex items-center justify-center text-xs font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 underline-offset-4 hover:underline h-9 rounded-md px-3 text-red-500", children: [
|
|
169
170
|
/* @__PURE__ */ e.jsxs(
|
|
170
171
|
"svg",
|
|
171
172
|
{
|
|
@@ -186,100 +187,100 @@ const be = () => {
|
|
|
186
187
|
]
|
|
187
188
|
}
|
|
188
189
|
),
|
|
189
|
-
"
|
|
190
|
+
r("remove")
|
|
190
191
|
] }) })
|
|
191
192
|
] })
|
|
192
193
|
]
|
|
193
194
|
},
|
|
194
195
|
s.providerKey
|
|
195
196
|
)) }),
|
|
196
|
-
/* @__PURE__ */ e.jsx(
|
|
197
|
+
/* @__PURE__ */ e.jsx(be, { onClose: () => v(null), provider: c })
|
|
197
198
|
] })
|
|
198
199
|
] });
|
|
199
|
-
},
|
|
200
|
-
let
|
|
201
|
-
const
|
|
202
|
-
const
|
|
203
|
-
"add-blocks":
|
|
204
|
-
layers:
|
|
205
|
-
"branding-options":
|
|
206
|
-
images:
|
|
200
|
+
}, we = y(() => import("./AddBlocks-1DrS62uN.js")), A = y(() => import("./Layers-6Fa_6Vy2.js")), ke = y(() => import("./BrandingOptions-zFJ28xmJ.js")), Ce = y(() => import("./index-0OqmBgqo.js").then((r) => r.cy));
|
|
201
|
+
let E = null;
|
|
202
|
+
const Ns = () => {
|
|
203
|
+
const r = C("sideBarComponents.top", []), t = C("sideBarComponents.bottom", []), [a, i] = P(me), [m, o] = u(a), [n, N] = u(null), f = {
|
|
204
|
+
"add-blocks": we,
|
|
205
|
+
layers: A,
|
|
206
|
+
"branding-options": ke,
|
|
207
|
+
images: Ce
|
|
207
208
|
};
|
|
208
|
-
R(
|
|
209
|
-
|
|
209
|
+
R(r, ({ name: l, panel: h }) => {
|
|
210
|
+
f[l] = h;
|
|
210
211
|
});
|
|
211
|
-
const
|
|
212
|
-
clearTimeout(
|
|
213
|
-
}, [,
|
|
214
|
-
function
|
|
212
|
+
const c = (l) => {
|
|
213
|
+
clearTimeout(E), v(!1), a !== "layers" && l === "layers" ? E = setTimeout(() => o("layers"), 500) : o(l), i(l);
|
|
214
|
+
}, [, v] = P(xe), w = C("dataBindingSupport", !1);
|
|
215
|
+
function k() {
|
|
215
216
|
const l = setTimeout(() => {
|
|
216
|
-
|
|
217
|
+
n && (c("layers"), clearTimeout(n));
|
|
217
218
|
}, 500);
|
|
218
|
-
|
|
219
|
+
N(l);
|
|
219
220
|
}
|
|
220
221
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex ", children: [
|
|
221
|
-
|
|
222
|
+
a !== "layers" ? /* @__PURE__ */ e.jsx(
|
|
222
223
|
"div",
|
|
223
224
|
{
|
|
224
|
-
onMouseEnter:
|
|
225
|
-
onClick: () =>
|
|
225
|
+
onMouseEnter: k,
|
|
226
|
+
onClick: () => c("layers"),
|
|
226
227
|
className: "fixed inset-0 bg-black/20 z-[50]"
|
|
227
228
|
}
|
|
228
229
|
) : null,
|
|
229
230
|
/* @__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: [
|
|
230
231
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: [
|
|
231
232
|
/* @__PURE__ */ e.jsx(
|
|
232
|
-
|
|
233
|
+
b,
|
|
233
234
|
{
|
|
234
235
|
onClick: () => {
|
|
235
|
-
|
|
236
|
+
c("add-blocks");
|
|
236
237
|
},
|
|
237
238
|
size: "sm",
|
|
238
|
-
variant:
|
|
239
|
-
children: /* @__PURE__ */ e.jsx(
|
|
239
|
+
variant: a === "add-blocks" ? "default" : "outline",
|
|
240
|
+
children: /* @__PURE__ */ e.jsx(V, { className: "text-xl" })
|
|
240
241
|
}
|
|
241
242
|
),
|
|
242
243
|
/* @__PURE__ */ e.jsx(
|
|
243
|
-
|
|
244
|
+
b,
|
|
244
245
|
{
|
|
245
|
-
onClick: () =>
|
|
246
|
+
onClick: () => c("layers"),
|
|
246
247
|
size: "sm",
|
|
247
|
-
variant:
|
|
248
|
-
children: /* @__PURE__ */ e.jsx(
|
|
248
|
+
variant: a === "layers" ? "default" : "outline",
|
|
249
|
+
children: /* @__PURE__ */ e.jsx(D, { className: "w-4" })
|
|
249
250
|
}
|
|
250
251
|
),
|
|
251
252
|
/* @__PURE__ */ e.jsx(
|
|
252
|
-
|
|
253
|
+
b,
|
|
253
254
|
{
|
|
254
|
-
onClick: () =>
|
|
255
|
+
onClick: () => c("branding-options"),
|
|
255
256
|
size: "sm",
|
|
256
|
-
variant:
|
|
257
|
-
children: /* @__PURE__ */ e.jsx(
|
|
257
|
+
variant: a === "branding-options" ? "default" : "outline",
|
|
258
|
+
children: /* @__PURE__ */ e.jsx(M, { className: "w-4 max-w-[40px] text-xs" })
|
|
258
259
|
}
|
|
259
260
|
),
|
|
260
261
|
p.Children.toArray(
|
|
261
|
-
|
|
262
|
-
|
|
262
|
+
r.map(({ name: l, icon: h }) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(
|
|
263
|
+
b,
|
|
263
264
|
{
|
|
264
|
-
onClick: () =>
|
|
265
|
+
onClick: () => c(l),
|
|
265
266
|
size: "sm",
|
|
266
267
|
className: "w-10",
|
|
267
|
-
variant:
|
|
268
|
-
children: /* @__PURE__ */ e.jsx(
|
|
268
|
+
variant: a === l ? "default" : "outline",
|
|
269
|
+
children: /* @__PURE__ */ e.jsx(h, {})
|
|
269
270
|
}
|
|
270
271
|
) }))
|
|
271
272
|
)
|
|
272
273
|
] }),
|
|
273
274
|
/* @__PURE__ */ e.jsx("div", { className: "relative z-[100] flex w-14 flex-col items-center space-y-2", children: p.Children.toArray(
|
|
274
|
-
|
|
275
|
+
t.map((l) => /* @__PURE__ */ e.jsx(j, { fallback: /* @__PURE__ */ e.jsx(z, { className: "h-10" }), children: /* @__PURE__ */ e.jsx(l, {}) }))
|
|
275
276
|
) })
|
|
276
277
|
] }),
|
|
277
278
|
/* @__PURE__ */ e.jsx(
|
|
278
279
|
"div",
|
|
279
280
|
{
|
|
280
|
-
className: `fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${
|
|
281
|
+
className: `fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${a !== "layers" ? "translate-x-0" : "-translate-x-full"}`,
|
|
281
282
|
children: /* @__PURE__ */ e.jsx(
|
|
282
|
-
|
|
283
|
+
j,
|
|
283
284
|
{
|
|
284
285
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 bg-white p-4", children: [
|
|
285
286
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
@@ -289,11 +290,11 @@ const bs = () => {
|
|
|
289
290
|
children: /* @__PURE__ */ e.jsx(
|
|
290
291
|
"div",
|
|
291
292
|
{
|
|
292
|
-
className:
|
|
293
|
+
className: je("relative h-full max-h-[93%] bg-background p-1", a === "layers" ? "" : "z-[100]"),
|
|
293
294
|
onMouseEnter: () => {
|
|
294
|
-
|
|
295
|
+
n && clearTimeout(n);
|
|
295
296
|
},
|
|
296
|
-
children: p.createElement(
|
|
297
|
+
children: p.createElement(J(f, m, () => /* @__PURE__ */ e.jsx("div", {})))
|
|
297
298
|
}
|
|
298
299
|
)
|
|
299
300
|
}
|
|
@@ -301,37 +302,37 @@ const bs = () => {
|
|
|
301
302
|
}
|
|
302
303
|
),
|
|
303
304
|
/* @__PURE__ */ e.jsx("div", { className: "h-full w-60 border-r p-1", children: /* @__PURE__ */ e.jsx(
|
|
304
|
-
|
|
305
|
+
j,
|
|
305
306
|
{
|
|
306
307
|
fallback: /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-2 p-4", children: [
|
|
307
308
|
/* @__PURE__ */ e.jsx("div", { className: "h-6 w-1/2 bg-gray-300" }),
|
|
308
309
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" }),
|
|
309
310
|
/* @__PURE__ */ e.jsx("div", { className: "h-16 w-full bg-gray-200" })
|
|
310
311
|
] }),
|
|
311
|
-
children: w ? /* @__PURE__ */ e.jsxs(
|
|
312
|
-
/* @__PURE__ */ e.jsxs(
|
|
313
|
-
/* @__PURE__ */ e.jsxs(
|
|
314
|
-
/* @__PURE__ */ e.jsx(
|
|
312
|
+
children: w ? /* @__PURE__ */ e.jsxs(pe, { defaultValue: "layers", className: "flex h-full w-full flex-col py-1", children: [
|
|
313
|
+
/* @__PURE__ */ e.jsxs(ue, { className: "mx-1 h-10 grid grid-cols-2", children: [
|
|
314
|
+
/* @__PURE__ */ e.jsxs(K, { value: "layers", children: [
|
|
315
|
+
/* @__PURE__ */ e.jsx(D, { className: "h-3 mr-2" }),
|
|
315
316
|
" Layers"
|
|
316
317
|
] }),
|
|
317
|
-
/* @__PURE__ */ e.jsxs(
|
|
318
|
-
/* @__PURE__ */ e.jsx(
|
|
318
|
+
/* @__PURE__ */ e.jsxs(K, { value: "data-provider", children: [
|
|
319
|
+
/* @__PURE__ */ e.jsx(he, { className: "w-3 mr-2" }),
|
|
319
320
|
"Data"
|
|
320
321
|
] })
|
|
321
322
|
] }),
|
|
322
|
-
/* @__PURE__ */ e.jsx(
|
|
323
|
-
/* @__PURE__ */ e.jsx(
|
|
323
|
+
/* @__PURE__ */ e.jsx(B, { value: "layers", className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: p.createElement(A) }),
|
|
324
|
+
/* @__PURE__ */ e.jsx(B, { value: "data-provider", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Ne, {}) })
|
|
324
325
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
325
326
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center bg-gray-200 rounded-md py-1", children: [
|
|
326
|
-
/* @__PURE__ */ e.jsx(
|
|
327
|
+
/* @__PURE__ */ e.jsx(D, { className: "h-4 mr-2 ml-2" }),
|
|
327
328
|
" Layers"
|
|
328
329
|
] }),
|
|
329
|
-
/* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: p.createElement(
|
|
330
|
+
/* @__PURE__ */ e.jsx("div", { className: "no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden", children: p.createElement(A) })
|
|
330
331
|
] })
|
|
331
332
|
}
|
|
332
333
|
) })
|
|
333
334
|
] });
|
|
334
335
|
};
|
|
335
336
|
export {
|
|
336
|
-
|
|
337
|
+
Ns as default
|
|
337
338
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),x=require("react"),P=require("./lodash-2us0VT8I.cjs"),t=require("./index-d55M5MRz.cjs"),g=require("./controls-QnyBNkXG.cjs"),R=require("./form-6qGAOYI3.cjs"),f=require("./index-Ge20J9Pa.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-37UXq2O5.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-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-aAZkA0f5.cjs");require("himalaya");require("lucide-react");const b=({closeModal:i})=>{var l,o;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(q=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...q,...a}})},h={name:g.Ry({title:"Page Name",default:r.name}),slug:g.Ry({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},C=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=C;
|
|
@@ -2,9 +2,9 @@ import { j as t } from "./jsx-runtime-NV737rRe.js";
|
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { a0 as j } from "./lodash-3gkdNK5u.js";
|
|
4
4
|
import { al as b, B as u, ak as C, ba as A } from "./index-0OqmBgqo.js";
|
|
5
|
-
import {
|
|
5
|
+
import { R as g } from "./controls-kEuiMMDf.js";
|
|
6
6
|
import { F as D } from "./form-irY39wvJ.js";
|
|
7
|
-
import { g as N } from "./index-
|
|
7
|
+
import { g as N } from "./index-TWBwhGkh.js";
|
|
8
8
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
@@ -39,7 +39,6 @@ import "redux-undo";
|
|
|
39
39
|
import "@chaibuilder/runtime";
|
|
40
40
|
import "@react-hookz/web";
|
|
41
41
|
import "react-i18next";
|
|
42
|
-
import "lodash";
|
|
43
42
|
import "@rjsf/core";
|
|
44
43
|
import "@rjsf/validator-ajv8";
|
|
45
44
|
import "i18next";
|
|
@@ -53,7 +52,7 @@ import "sonner";
|
|
|
53
52
|
import "./html-to-json-Y5M0N8PH.js";
|
|
54
53
|
import "himalaya";
|
|
55
54
|
import "lucide-react";
|
|
56
|
-
const
|
|
55
|
+
const R = ({ closeModal: e }) => {
|
|
57
56
|
var p, s;
|
|
58
57
|
const i = N(), [o, f] = c({
|
|
59
58
|
name: "",
|
|
@@ -93,13 +92,13 @@ const S = ({ closeModal: e }) => {
|
|
|
93
92
|
}
|
|
94
93
|
) })
|
|
95
94
|
] });
|
|
96
|
-
},
|
|
95
|
+
}, St = () => {
|
|
97
96
|
const [e, i] = c(!1);
|
|
98
97
|
return /* @__PURE__ */ t.jsxs(C, { open: e, onOpenChange: () => i(!e), children: [
|
|
99
98
|
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!e), children: "+ New Page" }) }),
|
|
100
|
-
e && /* @__PURE__ */ t.jsx(
|
|
99
|
+
e && /* @__PURE__ */ t.jsx(R, { closeModal: () => i(!e) })
|
|
101
100
|
] });
|
|
102
101
|
};
|
|
103
102
|
export {
|
|
104
|
-
|
|
103
|
+
St as default
|
|
105
104
|
};
|