@chaibuilder/sdk 0.1.20 → 0.1.21
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-a2677462.js → AddBlocks-b2d43d6c.js} +5 -6
- package/dist/AddBlocks-b510ac3a.cjs +3 -0
- package/dist/BrandingOptions-6fbe4b26.cjs +1 -0
- package/dist/{BrandingOptions-a95cba65.js → BrandingOptions-7f66e02c.js} +5 -6
- package/dist/{CanvasArea-ab550e9c.js → CanvasArea-68841a13.js} +10 -11
- package/dist/{CanvasArea-f1083634.cjs → CanvasArea-a8d28eb3.cjs} +6 -6
- package/dist/{CurrentPage-12828412.js → CurrentPage-6655ce50.js} +5 -6
- package/dist/CurrentPage-c10e6c89.cjs +1 -0
- package/dist/Layers-595cc98e.cjs +1 -0
- package/dist/{Layers-c429fafe.js → Layers-99bdc689.js} +48 -49
- package/dist/{MODIFIERS-c2e02614.js → MODIFIERS-2f19c314.js} +13 -7
- package/dist/MODIFIERS-4716c669.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-e49bcdc9.js → MarkAsGlobalBlock-522e170a.js} +5 -6
- package/dist/MarkAsGlobalBlock-ea769ea4.cjs +1 -0
- package/dist/{PagesPanel-2435351c.js → PagesPanel-b0debeed.js} +5 -6
- package/dist/PagesPanel-e176d7e8.cjs +1 -0
- package/dist/{ProjectPanel-e2860893.js → ProjectPanel-9cec967c.js} +6 -7
- package/dist/ProjectPanel-d0f33df2.cjs +1 -0
- package/dist/Settings-208ab051.cjs +1 -0
- package/dist/{Settings-17279d90.js → Settings-fd1e3b5d.js} +82 -83
- package/dist/SidePanels-40966390.cjs +1 -0
- package/dist/{SidePanels-95d3316d.js → SidePanels-ca294b35.js} +6 -7
- package/dist/{Topbar-8d1f6f53.js → Topbar-1edef1b2.js} +15 -16
- package/dist/Topbar-75c99c88.cjs +1 -0
- package/dist/add-page-modal-18f134c0.cjs +1 -0
- package/dist/{add-page-modal-b3c84063.js → add-page-modal-9985b5ce.js} +5 -6
- package/dist/core.cjs +1 -1
- package/dist/core.js +56 -57
- package/dist/delete-page-modal-393697d7.cjs +1 -0
- package/dist/{delete-page-modal-f9e9eb48.js → delete-page-modal-98272bf5.js} +8 -9
- package/dist/functions-83b1de8d.js +1106 -0
- package/dist/functions-f84d5e2a.cjs +2 -0
- package/dist/{html-to-json-8397fab5.js → html-to-json-45e0e3b5.js} +1 -1
- package/dist/{html-to-json-78bfa1f3.cjs → html-to-json-aadcbf66.cjs} +1 -1
- package/dist/{index-397e45a0.js → index-436bba3e.js} +110 -111
- package/dist/{index-2bda0975.cjs → index-c3a98a78.cjs} +40 -40
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +38 -0
- package/dist/lib.js +56 -45
- package/dist/page-viewer-32261f49.cjs +1 -0
- package/dist/{page-viewer-9c46bbbf.js → page-viewer-a3ac057a.js} +16 -17
- package/dist/{project-general-setting-a925e417.js → project-general-setting-21e324a9.js} +5 -6
- package/dist/project-general-setting-75a8e94b.cjs +1 -0
- package/dist/render.cjs +1 -2
- package/dist/render.d.ts +5 -16
- package/dist/render.js +86 -1178
- package/dist/{single-page-detail-60eae215.js → single-page-detail-0e881b82.js} +6 -7
- package/dist/single-page-detail-649b1379.cjs +1 -0
- package/package.json +1 -1
- package/dist/AddBlocks-48294c91.cjs +0 -3
- package/dist/BrandingOptions-c2922757.cjs +0 -1
- package/dist/CurrentPage-4d4a026f.cjs +0 -1
- package/dist/Layers-7d1616f9.cjs +0 -1
- package/dist/MODIFIERS-70fef873.cjs +0 -1
- package/dist/MarkAsGlobalBlock-43d26539.cjs +0 -1
- package/dist/PagesPanel-e89d30f7.cjs +0 -1
- package/dist/ProjectPanel-b110dffd.cjs +0 -1
- package/dist/Settings-632f6372.cjs +0 -1
- package/dist/SidePanels-b8fe9623.cjs +0 -1
- package/dist/Topbar-e7e27347.cjs +0 -1
- package/dist/_commonjsHelpers-10dfc225.js +0 -8
- package/dist/_commonjsHelpers-87b0abe8.cjs +0 -1
- package/dist/add-page-modal-79f99652.cjs +0 -1
- package/dist/delete-page-modal-bfe98708.cjs +0 -1
- package/dist/page-viewer-1763df5e.cjs +0 -1
- package/dist/project-general-setting-08e5996d.cjs +0 -1
- package/dist/single-page-detail-23bfb732.cjs +0 -1
|
@@ -2,13 +2,13 @@ import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
|
2
2
|
import * as se from "react";
|
|
3
3
|
import $, { useState as k, useEffect as M, useMemo as T, useCallback as I, createContext as Le, useContext as ee } from "react";
|
|
4
4
|
import { useThrottledCallback as xe } from "@react-hookz/web";
|
|
5
|
-
import { map as C, isEmpty as b, last as he, forEach as fe, set as Pe, startCase as Q, filter as Oe, get as g, isArray as
|
|
5
|
+
import { map as C, isEmpty as b, last as he, forEach as fe, set as Pe, startCase as Q, filter as Oe, get as g, isArray as ye, omit as at, includes as O, toLower as ne, first as be, split as Ne, truncate as it, keys as dt, cloneDeep as ct, each as pt, capitalize as ut, reject as gt, nth as Se, startsWith as Z, isNumber as xt, parseInt as ht, isNaN as Me, findLast as yt, has as ue, flatten as z, intersection as _e, isNull as mt } from "lodash";
|
|
6
6
|
import { useTranslation as Ee } from "react-i18next";
|
|
7
7
|
import { PlusIcon as ve, Cross2Icon as Fe, EyeOpenIcon as ft, EyeClosedIcon as Te, BorderAllIcon as _, WidthIcon as V, HeightIcon as H, ArrowUpIcon as G, ArrowRightIcon as K, ArrowDownIcon as q, ArrowLeftIcon as J, ArrowTopLeftIcon as bt, ArrowTopRightIcon as vt, ArrowBottomRightIcon as wt, ArrowBottomLeftIcon as jt, AlignLeftIcon as Ct, AlignCenterHorizontallyIcon as kt, AlignRightIcon as Nt, StretchHorizontallyIcon as St, FontItalicIcon as Tt, UnderlineIcon as Rt, OverlineIcon as Vt, LetterCaseUppercaseIcon as Ht, Cross1Icon as Bt, InfoCircledIcon as we, MinusIcon as At, BoxIcon as Xe, TriangleDownIcon as Dt, RowSpacingIcon as $t, TrashIcon as Ye, MixerHorizontalIcon as We } from "@radix-ui/react-icons";
|
|
8
8
|
import { T as It, a as Lt, b as Re, c as Ve } from "./tabs-85caa1e8.js";
|
|
9
9
|
import Pt from "@rjsf/core";
|
|
10
10
|
import Ot from "@rjsf/validator-ajv8";
|
|
11
|
-
import { D as te, d as Ze, G as ze, H as Mt, I as _t, J as Et, j as je, K as Ue, L as Ge, i as Ke, e as Ft, M as qe, f as He, N as ce, c as Xt, O as Yt, P as Wt } from "./index-
|
|
11
|
+
import { D as te, d as Ze, G as ze, H as Mt, I as _t, J as Et, j as je, K as Ue, L as Ge, i as Ke, e as Ft, M as qe, f as He, N as ce, c as Xt, O as Yt, P as Wt } from "./index-436bba3e.js";
|
|
12
12
|
import { getBlockComponent as Je, SingleLineText as Zt } from "@chaibuilder/blocks";
|
|
13
13
|
import { TrashIcon as zt, ChevronRight as Ut } from "lucide-react";
|
|
14
14
|
import Qe from "react-autosuggest";
|
|
@@ -18,9 +18,9 @@ import { A as tt, a as ae, b as ie, c as de } from "./accordion-c0176dc5.js";
|
|
|
18
18
|
import { R as qt, I as Jt, a as Qt, L as er } from "./link-2af5de8b.js";
|
|
19
19
|
import { useAtom as tr } from "jotai";
|
|
20
20
|
import rr from "fuse.js";
|
|
21
|
-
import { A as lr, C as pe, d as or } from "./html-to-json-
|
|
21
|
+
import { A as lr, C as pe, d as or } from "./html-to-json-45e0e3b5.js";
|
|
22
22
|
import { L as Ce } from "./label-e770a087.js";
|
|
23
|
-
import { S as sr } from "./MODIFIERS-
|
|
23
|
+
import { S as sr } from "./MODIFIERS-2f19c314.js";
|
|
24
24
|
import { I as nr } from "./input-a0ea2bc7.js";
|
|
25
25
|
import { S as ar } from "./scroll-area-83bd9e8f.js";
|
|
26
26
|
import { S as ir, c as dr, b as cr, d as pr, f as A } from "./select-7fddd7c3.js";
|
|
@@ -28,7 +28,6 @@ import "@radix-ui/react-tabs";
|
|
|
28
28
|
import "./utils-ac68b2c8.js";
|
|
29
29
|
import "clsx";
|
|
30
30
|
import "tailwind-merge";
|
|
31
|
-
import "./_commonjsHelpers-10dfc225.js";
|
|
32
31
|
import "@radix-ui/react-scroll-area";
|
|
33
32
|
import "react-dom";
|
|
34
33
|
import "@floating-ui/react-dom";
|
|
@@ -57,8 +56,8 @@ function ur(r) {
|
|
|
57
56
|
const s = [], t = {};
|
|
58
57
|
function n(l, a) {
|
|
59
58
|
fe(a, (d, i) => {
|
|
60
|
-
const o = l ? `${l}.${i}` : i, p =
|
|
61
|
-
s.push(o), t[o] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !
|
|
59
|
+
const o = l ? `${l}.${i}` : i, p = ye(d) ? "list" : typeof d;
|
|
60
|
+
s.push(o), t[o] = p === "string" ? "text" : p === "object" ? "model" : p, p === "object" && !ye(d) && n(o, d);
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
return n("", at(r, ["styles", "_type", "_id", "_name", "_bindings"])), { paths: s, pathsType: t };
|
|
@@ -78,14 +77,14 @@ const gr = ({ data: r }) => {
|
|
|
78
77
|
dataType: d,
|
|
79
78
|
appliedBindings: i
|
|
80
79
|
}) => {
|
|
81
|
-
const [o, p] = k(n), { paths: u, pathsType: c } = ur(l),
|
|
80
|
+
const [o, p] = k(n), { paths: u, pathsType: c } = ur(l), y = r === "PROP" ? Je(l == null ? void 0 : l._type) : {};
|
|
82
81
|
M(() => {
|
|
83
82
|
b(o) && a("");
|
|
84
83
|
}, [o]), M(() => p(n), [n]);
|
|
85
84
|
const x = () => u.filter((f) => {
|
|
86
85
|
const j = b(o) || O(ne(f), ne(o));
|
|
87
|
-
return r === "PATH" ? j && d === g(c, f, "") : j && !O(i, f) && g(
|
|
88
|
-
}), [
|
|
86
|
+
return r === "PATH" ? j && d === g(c, f, "") : j && !O(i, f) && g(y, `props.${be(Ne(f, "."))}.binding`);
|
|
87
|
+
}), [m, v] = k(() => x());
|
|
89
88
|
M(() => v(() => x()), [d]);
|
|
90
89
|
const L = {
|
|
91
90
|
autoComplete: "off",
|
|
@@ -123,7 +122,7 @@ const gr = ({ data: r }) => {
|
|
|
123
122
|
return /* @__PURE__ */ e.jsx(
|
|
124
123
|
Qe,
|
|
125
124
|
{
|
|
126
|
-
suggestions:
|
|
125
|
+
suggestions: m,
|
|
127
126
|
onSuggestionsFetchRequested: () => v(() => x()),
|
|
128
127
|
onSuggestionsClearRequested: () => v([]),
|
|
129
128
|
onSuggestionSelected: (f) => {
|
|
@@ -158,10 +157,10 @@ const gr = ({ data: r }) => {
|
|
|
158
157
|
return "";
|
|
159
158
|
{
|
|
160
159
|
const c = g(u === "PROP" ? n : l, p, "");
|
|
161
|
-
if (
|
|
160
|
+
if (ye(c))
|
|
162
161
|
return "list";
|
|
163
|
-
const
|
|
164
|
-
return
|
|
162
|
+
const y = typeof c;
|
|
163
|
+
return y === "string" ? "text" : y === "object" ? "model" : y;
|
|
165
164
|
}
|
|
166
165
|
};
|
|
167
166
|
return M(() => i(() => o(r.key, "PROP")), [r.key]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 border border-gray-200 relative rounded-md p-2", children: [
|
|
@@ -209,9 +208,9 @@ const gr = ({ data: r }) => {
|
|
|
209
208
|
] })
|
|
210
209
|
] });
|
|
211
210
|
}, hr = ({ bindingData: r, onChange: s }) => {
|
|
212
|
-
const t = te(), [n] = Gt(), [l, a] = k(C(r, (c,
|
|
211
|
+
const t = te(), [n] = Gt(), [l, a] = k(C(r, (c, y) => ({ key: y, value: c })));
|
|
213
212
|
M(() => {
|
|
214
|
-
a(C(r, (c,
|
|
213
|
+
a(C(r, (c, y) => ({ key: y, value: c })));
|
|
215
214
|
}, [t == null ? void 0 : t._id]);
|
|
216
215
|
const d = T(() => {
|
|
217
216
|
if (b(l))
|
|
@@ -221,31 +220,31 @@ const gr = ({ data: r }) => {
|
|
|
221
220
|
}, [l]), i = () => {
|
|
222
221
|
a([...l, { key: "", value: "" }]);
|
|
223
222
|
}, o = (c) => {
|
|
224
|
-
const
|
|
225
|
-
u([...
|
|
226
|
-
}, p = (c,
|
|
223
|
+
const y = Oe(l, (x, m) => c !== m);
|
|
224
|
+
u([...y]);
|
|
225
|
+
}, p = (c, y) => {
|
|
227
226
|
const x = [...l];
|
|
228
|
-
x[
|
|
227
|
+
x[y][c.target.name] = c.target.value, u(x);
|
|
229
228
|
}, u = I(
|
|
230
229
|
(c = []) => {
|
|
231
230
|
if (a(c), b(c)) {
|
|
232
231
|
s({});
|
|
233
232
|
return;
|
|
234
233
|
}
|
|
235
|
-
const
|
|
234
|
+
const y = {};
|
|
236
235
|
fe(c, (x) => {
|
|
237
|
-
!b(x == null ? void 0 : x.key) && !b(x == null ? void 0 : x.value) && Pe(
|
|
238
|
-
}), s(
|
|
236
|
+
!b(x == null ? void 0 : x.key) && !b(x == null ? void 0 : x.value) && Pe(y, x.key, x.value);
|
|
237
|
+
}), s(y);
|
|
239
238
|
},
|
|
240
239
|
[t]
|
|
241
240
|
);
|
|
242
241
|
return b(n) ? /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400", children: "No data provider selected." }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
243
|
-
C(l, (c,
|
|
242
|
+
C(l, (c, y) => /* @__PURE__ */ e.jsx(
|
|
244
243
|
xr,
|
|
245
244
|
{
|
|
246
245
|
item: c,
|
|
247
|
-
onChange: (x) => p(x,
|
|
248
|
-
onRemove: () => o(
|
|
246
|
+
onChange: (x) => p(x, y),
|
|
247
|
+
onRemove: () => o(y),
|
|
249
248
|
selectedBlock: t,
|
|
250
249
|
dataProvider: n,
|
|
251
250
|
appliedBindings: C(l, "key")
|
|
@@ -265,7 +264,7 @@ const gr = ({ data: r }) => {
|
|
|
265
264
|
d && /* @__PURE__ */ e.jsx(W, { sideOffset: 10, className: "text-[11px]", children: "Complete last added data binding to add more" })
|
|
266
265
|
] })
|
|
267
266
|
] });
|
|
268
|
-
},
|
|
267
|
+
}, yr = hr, mr = () => /* @__PURE__ */ e.jsx("div", { className: "text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100", children: "Data binding is set for this field" }), Ae = ({
|
|
269
268
|
createHistorySnapshot: r,
|
|
270
269
|
properties: s,
|
|
271
270
|
formData: t,
|
|
@@ -282,7 +281,7 @@ const gr = ({ data: r }) => {
|
|
|
282
281
|
Pt,
|
|
283
282
|
{
|
|
284
283
|
widgets: {
|
|
285
|
-
binding:
|
|
284
|
+
binding: mr,
|
|
286
285
|
richtext: qt,
|
|
287
286
|
icon: Jt,
|
|
288
287
|
image: Qt
|
|
@@ -307,8 +306,8 @@ const gr = ({ data: r }) => {
|
|
|
307
306
|
function fr() {
|
|
308
307
|
const r = te(), { createSnapshot: s } = Ze(), t = ze(), n = Je(r._type), l = { ...r }, a = () => s(), d = ({ formData: u }, c) => {
|
|
309
308
|
if (c) {
|
|
310
|
-
const
|
|
311
|
-
t([r._id], { [
|
|
309
|
+
const y = c.replace("root.", "");
|
|
310
|
+
t([r._id], { [y]: g(u, y) });
|
|
312
311
|
}
|
|
313
312
|
}, i = {
|
|
314
313
|
_name: Zt({
|
|
@@ -344,7 +343,7 @@ function fr() {
|
|
|
344
343
|
"Data Binding"
|
|
345
344
|
] }) }),
|
|
346
345
|
/* @__PURE__ */ e.jsx(de, { className: "pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
347
|
-
|
|
346
|
+
yr,
|
|
348
347
|
{
|
|
349
348
|
bindingData: g(l, "_bindings", {}),
|
|
350
349
|
onChange: (u) => {
|
|
@@ -392,7 +391,7 @@ function br() {
|
|
|
392
391
|
const [r] = je(), s = te(), t = Ue(), n = Ge(), [l] = Ke(), [a, d] = k(""), i = (R = be(r)) == null ? void 0 : R.prop, o = gt((g(s, i, "").replace(sr, "").split(",").pop() || "").split(" "), b), p = () => {
|
|
393
392
|
const f = a.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
|
|
394
393
|
t(l, f, !0), d("");
|
|
395
|
-
}, [u, c] = k([]),
|
|
394
|
+
}, [u, c] = k([]), y = ({ value: f }) => {
|
|
396
395
|
const j = f.trim().toLowerCase(), B = j.match(/.+:/g);
|
|
397
396
|
let N = [];
|
|
398
397
|
if (B && B.length > 0) {
|
|
@@ -406,7 +405,7 @@ function br() {
|
|
|
406
405
|
c(C(N, "item"));
|
|
407
406
|
}, x = () => {
|
|
408
407
|
c([]);
|
|
409
|
-
},
|
|
408
|
+
}, m = (f) => f.name, v = (f) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: f.name }), L = {
|
|
410
409
|
autoComplete: "off",
|
|
411
410
|
autoCorrect: "off",
|
|
412
411
|
autoCapitalize: "off",
|
|
@@ -430,9 +429,9 @@ function br() {
|
|
|
430
429
|
Qe,
|
|
431
430
|
{
|
|
432
431
|
suggestions: u,
|
|
433
|
-
onSuggestionsFetchRequested:
|
|
432
|
+
onSuggestionsFetchRequested: y,
|
|
434
433
|
onSuggestionsClearRequested: x,
|
|
435
|
-
getSuggestionValue:
|
|
434
|
+
getSuggestionValue: m,
|
|
436
435
|
renderSuggestion: v,
|
|
437
436
|
inputProps: L,
|
|
438
437
|
containerProps: {
|
|
@@ -1113,7 +1112,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
|
1113
1112
|
/* @__PURE__ */ e.jsx(W, { children: "Current value is using a Tailwind arbitrary value." })
|
|
1114
1113
|
] })
|
|
1115
1114
|
] }) : /* @__PURE__ */ e.jsx(
|
|
1116
|
-
|
|
1115
|
+
me,
|
|
1117
1116
|
{
|
|
1118
1117
|
rounded: r,
|
|
1119
1118
|
onChange: (o) => t(o, s),
|
|
@@ -1123,7 +1122,7 @@ const D = ["px", "%", "em", "rem", "ch", "vh", "vw"], vr = {
|
|
|
1123
1122
|
}
|
|
1124
1123
|
) });
|
|
1125
1124
|
};
|
|
1126
|
-
function
|
|
1125
|
+
function me({ selected: r, onChange: s, rounded: t = !1, options: n, disabled: l = !1 }) {
|
|
1127
1126
|
const a = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = Ze();
|
|
1128
1127
|
return /* @__PURE__ */ e.jsxs(
|
|
1129
1128
|
"select",
|
|
@@ -1202,10 +1201,10 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1202
1201
|
ringColor: "ring",
|
|
1203
1202
|
ringOffsetColor: "ring-offset"
|
|
1204
1203
|
}, Tr = ({ property: r, onChange: s }) => {
|
|
1205
|
-
const t = le(r), n = T(() => g(t, "cls", ""), [t]), { canChange: l } = ee(re), [a, d] = k([]), [i, o] = k({ color: "", shade: "" }), p = n.split("-"), u = g(p, "1", ""), c = g(p, "2", ""),
|
|
1204
|
+
const t = le(r), n = T(() => g(t, "cls", ""), [t]), { canChange: l } = ee(re), [a, d] = k([]), [i, o] = k({ color: "", shade: "" }), p = n.split("-"), u = g(p, "1", ""), c = g(p, "2", ""), y = I(
|
|
1206
1205
|
// eslint-disable-next-line no-shadow
|
|
1207
|
-
(
|
|
1208
|
-
["current", "inherit", "transparent", "black", "white"].includes(
|
|
1206
|
+
(m) => {
|
|
1207
|
+
["current", "inherit", "transparent", "black", "white"].includes(m) ? (d([]), o({ color: m })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), o((v) => ({ ...v, color: m, shade: v.shade ? v.shade : "500" })));
|
|
1209
1208
|
},
|
|
1210
1209
|
[d, o]
|
|
1211
1210
|
);
|
|
@@ -1216,8 +1215,8 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1216
1215
|
}, [u]);
|
|
1217
1216
|
const x = I(
|
|
1218
1217
|
// eslint-disable-next-line no-shadow
|
|
1219
|
-
(
|
|
1220
|
-
o({ color: u, shade:
|
|
1218
|
+
(m) => {
|
|
1219
|
+
o({ color: u, shade: m });
|
|
1221
1220
|
},
|
|
1222
1221
|
[u]
|
|
1223
1222
|
);
|
|
@@ -1228,12 +1227,12 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1228
1227
|
v.match(new RegExp(g(pe, `${r}.regExp`, ""))) && s(v, r);
|
|
1229
1228
|
}, [i, s, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
|
|
1230
1229
|
/* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1231
|
-
|
|
1230
|
+
me,
|
|
1232
1231
|
{
|
|
1233
1232
|
disabled: !l,
|
|
1234
1233
|
rounded: !0,
|
|
1235
1234
|
selected: u,
|
|
1236
|
-
onChange:
|
|
1235
|
+
onChange: y,
|
|
1237
1236
|
options: [
|
|
1238
1237
|
"current",
|
|
1239
1238
|
"transparent",
|
|
@@ -1266,7 +1265,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1266
1265
|
]
|
|
1267
1266
|
}
|
|
1268
1267
|
) }),
|
|
1269
|
-
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(
|
|
1268
|
+
/* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(me, { rounded: !0, selected: c, disabled: !u || !l, onChange: x, options: a }) })
|
|
1270
1269
|
] });
|
|
1271
1270
|
}, $e = (r, s) => {
|
|
1272
1271
|
r = r.toLowerCase();
|
|
@@ -1461,14 +1460,14 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1461
1460
|
},
|
|
1462
1461
|
n
|
|
1463
1462
|
)) }), Dr = (r) => {
|
|
1464
|
-
const [s, t] = k(!1), [n, l] = k(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: o, units: p, negative: u } = r, [c,
|
|
1463
|
+
const [s, t] = k(!1), [n, l] = k(""), { currentClass: a, onChange: d, classPrefix: i, cssProperty: o, units: p, negative: u } = r, [c, y] = k(o != null && o.toLowerCase().includes("width") ? "%" : p[0]), [x, m] = k(!1), [v, L] = k(""), [R, f] = k(!1), [j, B] = k(!1);
|
|
1465
1464
|
M(() => {
|
|
1466
1465
|
const { value: h, unit: w } = Vr(a);
|
|
1467
1466
|
if (w === "") {
|
|
1468
|
-
l(h),
|
|
1467
|
+
l(h), y(o != null && o.toLowerCase().includes("width") ? "%" : p[0]);
|
|
1469
1468
|
return;
|
|
1470
1469
|
}
|
|
1471
|
-
|
|
1470
|
+
y(w), l(w === "class" || b(h) ? "" : h);
|
|
1472
1471
|
}, [a, o, p]);
|
|
1473
1472
|
const N = xe(
|
|
1474
1473
|
(h) => {
|
|
@@ -1486,7 +1485,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1486
1485
|
(h = !1) => {
|
|
1487
1486
|
const w = $e(`${n}`, p);
|
|
1488
1487
|
if (g(w, "error", !1)) {
|
|
1489
|
-
|
|
1488
|
+
m(!0);
|
|
1490
1489
|
return;
|
|
1491
1490
|
}
|
|
1492
1491
|
const S = g(w, "unit") !== "" ? g(w, "unit") : c;
|
|
@@ -1504,7 +1503,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1504
1503
|
(h) => {
|
|
1505
1504
|
const w = $e(`${n}`, p);
|
|
1506
1505
|
if (g(w, "error", !1)) {
|
|
1507
|
-
|
|
1506
|
+
m(!0);
|
|
1508
1507
|
return;
|
|
1509
1508
|
}
|
|
1510
1509
|
if (h === "auto" || h === "none") {
|
|
@@ -1548,7 +1547,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1548
1547
|
},
|
|
1549
1548
|
onBlur: () => F(),
|
|
1550
1549
|
onChange: (h) => {
|
|
1551
|
-
|
|
1550
|
+
m(!1), l(h.target.value);
|
|
1552
1551
|
},
|
|
1553
1552
|
onClick: (h) => {
|
|
1554
1553
|
var w;
|
|
@@ -1580,7 +1579,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1580
1579
|
units: p,
|
|
1581
1580
|
current: c,
|
|
1582
1581
|
onSelect: (h) => {
|
|
1583
|
-
t(!1),
|
|
1582
|
+
t(!1), y(h), oe(h);
|
|
1584
1583
|
}
|
|
1585
1584
|
}
|
|
1586
1585
|
) }) })
|
|
@@ -1612,7 +1611,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1612
1611
|
] }) }) });
|
|
1613
1612
|
}, le = (r) => {
|
|
1614
1613
|
const s = ce();
|
|
1615
|
-
return
|
|
1614
|
+
return yt(s, { property: r });
|
|
1616
1615
|
}, $r = (r, s) => {
|
|
1617
1616
|
const t = {
|
|
1618
1617
|
xs: 0,
|
|
@@ -1698,7 +1697,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1698
1697
|
"2xl": "1536px"
|
|
1699
1698
|
}, Lr = (r) => `${r.toUpperCase()} ${Ie[r] ? `(${Ie[r]} & up)` : ""}`, ke = (r) => {
|
|
1700
1699
|
const { type: s = "icons", label: t, property: n, onEmitChange: l = () => {
|
|
1701
|
-
}, units: a, negative: d = !1 } = r, [i] = Ft(), [o] = qe(), [, p] = He(), u = le(n), c = Ue(),
|
|
1700
|
+
}, units: a, negative: d = !1 } = r, [i] = Ft(), [o] = qe(), [, p] = He(), u = le(n), c = Ue(), y = Ge(), [x] = Ke(), m = T(() => g(u, "fullCls", ""), [u]), v = I(
|
|
1702
1701
|
(N, P = !0) => {
|
|
1703
1702
|
const F = { dark: i, mq: p, mod: o, cls: N, property: n, fullCls: "" };
|
|
1704
1703
|
(i || o !== "") && (F.mq = "xs");
|
|
@@ -1707,8 +1706,8 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1707
1706
|
},
|
|
1708
1707
|
[x, i, p, o, n, c]
|
|
1709
1708
|
), L = I(() => {
|
|
1710
|
-
|
|
1711
|
-
}, [x,
|
|
1709
|
+
y(x, [m]);
|
|
1710
|
+
}, [x, m, y]), R = T(() => $r(u, p), [u, p]);
|
|
1712
1711
|
M(() => {
|
|
1713
1712
|
l(R, u);
|
|
1714
1713
|
}, [R, l, u]);
|
|
@@ -1745,7 +1744,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1745
1744
|
s === "color" && /* @__PURE__ */ e.jsx(Tr, { property: n, onChange: v }),
|
|
1746
1745
|
s === "dropdown" && /* @__PURE__ */ e.jsx(lt, { label: t, property: n, onChange: v })
|
|
1747
1746
|
] }),
|
|
1748
|
-
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${
|
|
1747
|
+
/* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${m ? "visible" : "invisible"}`, children: B ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => L(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Ye, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : R && u ? /* @__PURE__ */ e.jsxs(X, { delayDuration: 100, children: [
|
|
1749
1748
|
/* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1750
1749
|
"button",
|
|
1751
1750
|
{
|
|
@@ -1795,18 +1794,18 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1795
1794
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
|
|
1796
1795
|
r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: r }),
|
|
1797
1796
|
/* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: $.Children.toArray(
|
|
1798
|
-
s.map(({ label: c, key:
|
|
1797
|
+
s.map(({ label: c, key: y }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1799
1798
|
/* @__PURE__ */ e.jsx(Y, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1800
1799
|
"button",
|
|
1801
1800
|
{
|
|
1802
1801
|
type: "button",
|
|
1803
|
-
onClick: () => o(
|
|
1804
|
-
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${
|
|
1802
|
+
onClick: () => o(y),
|
|
1803
|
+
className: `relative cursor-pointer rounded-full p-1 text-[8px] ${y === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
|
|
1805
1804
|
children: [
|
|
1806
1805
|
$.createElement("div", {
|
|
1807
|
-
className: u(
|
|
1806
|
+
className: u(y) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
|
|
1808
1807
|
}),
|
|
1809
|
-
$.createElement(g(rt,
|
|
1808
|
+
$.createElement(g(rt, y, Xe), { className: "text-inherit w-3 h-3" })
|
|
1810
1809
|
]
|
|
1811
1810
|
}
|
|
1812
1811
|
) }),
|
|
@@ -1923,24 +1922,24 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1923
1922
|
)
|
|
1924
1923
|
] })
|
|
1925
1924
|
] }), Er = ({ section: r }) => {
|
|
1926
|
-
var
|
|
1925
|
+
var y;
|
|
1927
1926
|
const { setSyncState: s } = Xt(), t = te(), [n, l] = k([]), [a] = je(), d = ze(), i = `${g(a, "0.prop")}_attrs`;
|
|
1928
1927
|
se.useEffect(() => {
|
|
1929
|
-
const x = C(g(t, i), (
|
|
1928
|
+
const x = C(g(t, i), (m, v) => ({ key: v, value: m }));
|
|
1930
1929
|
b(x) ? l([]) : l(x);
|
|
1931
1930
|
}, [g(t, i)]);
|
|
1932
1931
|
const o = () => l([...n, { key: "", value: "" }]), p = (x) => {
|
|
1933
|
-
const
|
|
1934
|
-
c(
|
|
1935
|
-
}, u = (x,
|
|
1932
|
+
const m = Oe(n, (v, L) => x !== L);
|
|
1933
|
+
c(m);
|
|
1934
|
+
}, u = (x, m) => {
|
|
1936
1935
|
const v = [...n];
|
|
1937
|
-
v[
|
|
1936
|
+
v[m][x.target.name] = x.target.value, c(v);
|
|
1938
1937
|
}, c = se.useCallback(
|
|
1939
1938
|
(x = []) => {
|
|
1940
|
-
const
|
|
1939
|
+
const m = {};
|
|
1941
1940
|
fe(x, (v) => {
|
|
1942
|
-
b(v.key) || Pe(
|
|
1943
|
-
}), d([g(t, "_id")], { [i]:
|
|
1941
|
+
b(v.key) || Pe(m, v.key, v.value);
|
|
1942
|
+
}), d([g(t, "_id")], { [i]: m }), s("UNSAVED");
|
|
1944
1943
|
},
|
|
1945
1944
|
[t, s, d, i]
|
|
1946
1945
|
);
|
|
@@ -1960,7 +1959,7 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1960
1959
|
/* @__PURE__ */ e.jsxs(
|
|
1961
1960
|
"div",
|
|
1962
1961
|
{
|
|
1963
|
-
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(n) && b((
|
|
1962
|
+
className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!b(n) && b((y = he(n)) == null ? void 0 : y.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
|
|
1964
1963
|
onClick: () => {
|
|
1965
1964
|
var x;
|
|
1966
1965
|
!b(n) && b((x = he(n)) == null ? void 0 : x.key) || o();
|
|
@@ -1975,16 +1974,16 @@ const kr = ({ property: r, onChange: s }) => {
|
|
|
1975
1974
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1976
1975
|
b(n) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
|
|
1977
1976
|
se.Children.toArray(
|
|
1978
|
-
C(n, (x,
|
|
1979
|
-
const v = n.length > 0 &&
|
|
1977
|
+
C(n, (x, m) => {
|
|
1978
|
+
const v = n.length > 0 && m < n.length - 1;
|
|
1980
1979
|
return /* @__PURE__ */ e.jsx(
|
|
1981
1980
|
_r,
|
|
1982
1981
|
{
|
|
1983
1982
|
item: x,
|
|
1984
|
-
index:
|
|
1983
|
+
index: m,
|
|
1985
1984
|
canDelete: v,
|
|
1986
1985
|
onChange: u,
|
|
1987
|
-
onRemove: () => p(
|
|
1986
|
+
onRemove: () => p(m)
|
|
1988
1987
|
}
|
|
1989
1988
|
);
|
|
1990
1989
|
})
|
|
@@ -2050,7 +2049,7 @@ const Xr = {
|
|
|
2050
2049
|
"-": 1,
|
|
2051
2050
|
deg: 1,
|
|
2052
2051
|
ms: 0.1
|
|
2053
|
-
},
|
|
2052
|
+
}, Xl = () => {
|
|
2054
2053
|
const r = te(), { t: s } = Ee(), [t, n] = $.useState(""), [l, a] = $.useState({
|
|
2055
2054
|
onDrag: (o) => o,
|
|
2056
2055
|
onDragEnd: (o) => o,
|
|
@@ -2065,10 +2064,10 @@ const Xr = {
|
|
|
2065
2064
|
const p = !g(l, "negative", !1), u = g(l, "cssProperty", "");
|
|
2066
2065
|
let c = parseFloat(l.dragStartValue);
|
|
2067
2066
|
c = Me(c) ? 0 : c;
|
|
2068
|
-
let
|
|
2069
|
-
(Z(u, "scale") || u === "opacity") && (
|
|
2070
|
-
let
|
|
2071
|
-
p &&
|
|
2067
|
+
let y = Xr[l.dragUnit];
|
|
2068
|
+
(Z(u, "scale") || u === "opacity") && (y = 10);
|
|
2069
|
+
let m = (l.dragStartY - o.pageY) / y + c;
|
|
2070
|
+
p && m < 0 && (m = 0), u === "opacity" && m > 1 && (m = 1), l.onDrag(`${m}`), n(`${m}`);
|
|
2072
2071
|
},
|
|
2073
2072
|
[l],
|
|
2074
2073
|
50
|
|
@@ -2084,7 +2083,7 @@ const Xr = {
|
|
|
2084
2083
|
cssProperty: ""
|
|
2085
2084
|
});
|
|
2086
2085
|
}, [l, t, a]);
|
|
2087
|
-
return
|
|
2086
|
+
return mt(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
|
|
2088
2087
|
/* @__PURE__ */ e.jsx(We, { className: "mx-auto text-3xl" }),
|
|
2089
2088
|
/* @__PURE__ */ e.jsx("h1", { children: s("no_block_selected_for_styling") })
|
|
2090
2089
|
] }) }) : /* @__PURE__ */ e.jsxs(ot.Provider, { value: { setDragData: a }, children: [
|
|
@@ -2114,5 +2113,5 @@ const Xr = {
|
|
|
2114
2113
|
] });
|
|
2115
2114
|
};
|
|
2116
2115
|
export {
|
|
2117
|
-
|
|
2116
|
+
Xl as default
|
|
2118
2117
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),S=require("@radix-ui/react-icons"),t=require("react"),C=require("jotai"),l=require("lodash"),a=require("./useBuilderProp-5e57d0c8.cjs"),j=require("./tabs-860e37aa.cjs"),g=require("./index-c3a98a78.cjs");require("react-i18next");const T=require("./utils-3c452dd0.cjs"),N=require("lucide-react"),D=require("@chaibuilder/blocks"),E=require("./dialog-170eaad9.cjs"),y=require("./card-14e1d020.cjs"),p=require("./select-0e32300c.cjs"),A=require("react-json-view");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-tabs");require("./MODIFIERS-4716c669.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-aadcbf66.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("sonner");require("tailwind-merge");require("@radix-ui/react-dialog");require("@radix-ui/react-select");const z=({provider:r,onClose:h})=>{const[i,c]=t.useState(null);return t.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(m=>c(m))},[r]),r?e.jsxRuntimeExports.jsx(E.Dialog,{onOpenChange:o=>o?"":h(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(E.DialogContent,{children:[e.jsxRuntimeExports.jsxs(E.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(E.DialogTitle,{children:["Data Provider: ",r.name]}),e.jsxRuntimeExports.jsx(E.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(A,{name:r.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:i})]})}):null},B=()=>{const r=t.useMemo(()=>D.getChaiDataProviders(),[]),[h,i]=g.usePageDataProviders(),[,c]=C.useAtom(g.pageSyncStateAtom),[o,m]=t.useState(l.filter(r,s=>l.map(h,"providerKey").includes(s.providerKey))),[x,R]=t.useState(""),[f,u]=t.useState(null),b=l.filter(r.map(s=>l.map(o,"providerKey").includes(s.providerKey)?null:{value:s.providerKey,label:s.name}),s=>!l.isNull(s)),n=()=>{const s=l.find(r,{providerKey:x});m(d=>[...d,s]),i(d=>[...d,{providerKey:s.providerKey,args:{}}]),R(""),c("UNSAVED")},v=s=>{m(d=>l.filter(d,q=>q.providerKey!==s.providerKey)),i(d=>l.filter(d,q=>q.providerKey!==s.providerKey)),c("UNSAVED")},k=s=>u(s);return e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Add data providers:"})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxRuntimeExports.jsxs(p.Select,{value:x,onValueChange:s=>R(s),children:[e.jsxRuntimeExports.jsx(p.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(p.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(p.SelectContent,{children:[e.jsxRuntimeExports.jsx(p.SelectItem,{value:"",children:"Choose"}),b.map(s=>e.jsxRuntimeExports.jsx(p.SelectItem,{value:s.value,children:s.label},s.value))]})]}),e.jsxRuntimeExports.jsx(a.Button,{onClick:n,disabled:l.isEmpty(x),variant:"destructive",children:"+"})]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:o.length?"block":"hidden",children:[e.jsxRuntimeExports.jsx("hr",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Page data providers:"}),o.map(s=>e.jsxRuntimeExports.jsx(y.Card,{className:"mt-2 rounded-md",children:e.jsxRuntimeExports.jsxs(y.CardHeader,{className:"p-2",children:[e.jsxRuntimeExports.jsx(y.CardTitle,{children:s.name}),e.jsxRuntimeExports.jsx(y.CardDescription,{children:s.description}),e.jsxRuntimeExports.jsx("button",{onClick:()=>k(s),className:"text-left text-xs text-blue-500",children:"view data"}),e.jsxRuntimeExports.jsx("button",{onClick:()=>v(s),className:"text-left text-xs text-red-500",children:"remove"})]})})),e.jsxRuntimeExports.jsx(z,{onClose:()=>u(null),provider:f})]})]})},w=t.lazy(()=>Promise.resolve().then(()=>require("./Layers-595cc98e.cjs"))),K=t.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-6fbe4b26.cjs"))),I=t.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-0db5c72f.cjs")));let P=null;const L=()=>{const r=a.useBuilderProp("sideBarComponents.top",[]),h=a.useBuilderProp("sideBarComponents.bottom",[]),[i,c]=C.useAtom(g.activePanelAtom),[o,m]=t.useState(i),[x,R]=t.useState(null),f={layers:w,"branding-options":K,images:I};l.each(r,({name:n,panel:v})=>{f[n]=v});const u=n=>{clearTimeout(P),b(!1),i!=="layers"&&n==="layers"?P=setTimeout(()=>m("layers"),500):m(n),c(n)},[,b]=C.useAtom(g.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[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(a.Button,{onClick:()=>{b(!0),c("layers")},size:"sm",variant:i==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(S.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(a.Button,{onClick:()=>u("layers"),size:"sm",variant:i==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(a.Button,{onClick:()=>u("branding-options"),size:"sm",variant:i==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(S.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),t.Children.toArray(r.map(({name:n,icon:v})=>e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsx(a.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(a.Button,{onClick:()=>u(n),size:"sm",className:"w-10",variant:i===n?"default":"outline",children:e.jsxRuntimeExports.jsx(v,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center space-y-2",children:t.Children.toArray(h.map(n=>e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsx(a.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{u("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(i==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${i!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:T.cn("relative h-full max-h-[93%] bg-background p-1",i==="layers"?"":"z-[100]"),onMouseEnter:()=>{x&&clearTimeout(x)},onMouseLeave:()=>{const n=setTimeout(()=>{x&&(u("layers"),clearTimeout(x))},1e3);R(n)},children:t.createElement(l.get(f,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(t.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:e.jsxRuntimeExports.jsxs(j.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(j.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(j.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(j.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(N.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(j.TabsContent,{value:"layers",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:t.createElement(w)}),e.jsxRuntimeExports.jsx(j.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(B,{})})]})})})]})};exports.default=L;
|
|
@@ -5,7 +5,7 @@ import { useAtom as N } from "jotai";
|
|
|
5
5
|
import { filter as y, map as w, isNull as H, isEmpty as M, find as O, each as _, get as F } from "lodash";
|
|
6
6
|
import { B as u, u as k, S as P } from "./useBuilderProp-81a14920.js";
|
|
7
7
|
import { T as R, a as J, b as D, c as S } from "./tabs-85caa1e8.js";
|
|
8
|
-
import { u as U, p as $, a as q, b as G } from "./index-
|
|
8
|
+
import { u as U, p as $, a as q, b as G } from "./index-436bba3e.js";
|
|
9
9
|
import "react-i18next";
|
|
10
10
|
import { c as Q } from "./utils-ac68b2c8.js";
|
|
11
11
|
import { ListTreeIcon as T, DatabaseIcon as W } from "lucide-react";
|
|
@@ -19,7 +19,7 @@ import "class-variance-authority";
|
|
|
19
19
|
import "@radix-ui/react-tooltip";
|
|
20
20
|
import "@radix-ui/react-toast";
|
|
21
21
|
import "@radix-ui/react-tabs";
|
|
22
|
-
import "./
|
|
22
|
+
import "./MODIFIERS-2f19c314.js";
|
|
23
23
|
import "clsx";
|
|
24
24
|
import "@radix-ui/react-scroll-area";
|
|
25
25
|
import "react-dom";
|
|
@@ -30,8 +30,7 @@ import "react-dnd";
|
|
|
30
30
|
import "@minoru/react-dnd-treeview";
|
|
31
31
|
import "react-hotkeys-hook";
|
|
32
32
|
import "flat-to-nested";
|
|
33
|
-
import "./html-to-json-
|
|
34
|
-
import "./MODIFIERS-c2e02614.js";
|
|
33
|
+
import "./html-to-json-45e0e3b5.js";
|
|
35
34
|
import "himalaya";
|
|
36
35
|
import "redux-undo";
|
|
37
36
|
import "@react-hookz/web";
|
|
@@ -101,9 +100,9 @@ const xe = ({ provider: a, onClose: x }) => {
|
|
|
101
100
|
/* @__PURE__ */ e.jsx(xe, { onClose: () => o(null), provider: h })
|
|
102
101
|
] })
|
|
103
102
|
] });
|
|
104
|
-
}, A = C(() => import("./Layers-
|
|
103
|
+
}, A = C(() => import("./Layers-99bdc689.js")), ue = C(() => import("./BrandingOptions-7f66e02c.js")), fe = C(() => import("./ImagesPanel-38c44785.js"));
|
|
105
104
|
let z = null;
|
|
106
|
-
const
|
|
105
|
+
const as = () => {
|
|
107
106
|
const a = k("sideBarComponents.top", []), x = k("sideBarComponents.bottom", []), [l, n] = N(q), [t, c] = m(l), [i, f] = m(null), h = {
|
|
108
107
|
layers: A,
|
|
109
108
|
"branding-options": ue,
|
|
@@ -239,5 +238,5 @@ const ls = () => {
|
|
|
239
238
|
] });
|
|
240
239
|
};
|
|
241
240
|
export {
|
|
242
|
-
|
|
241
|
+
as as default
|
|
243
242
|
};
|